title: Using async await to run SQL Server stored procedure in Nodejs
body: <p>I am new to using SQL Server with nodejs. I am using the <code>node-mssql</code> library. I am finding stored procedure to be a bit challenging.</p>
  
  <p>My stored procedure is:</p>
  
  <pre><code>CREATE PROCEDURE [dbo].[sp_addStudent] 
      @StudentID int, 
      @StudentName varchar(50), 
      @TimeStamp datetime, 
      @Notes varchar(MAX) 
  AS 
  BEGIN 
      INSERT INTO Students (StudentID , StudentName , [TimeStamp], Notes) 
      VALUES (@StudentID , @StudentName , @TimeStamp, @Notes); 
  END
  </code></pre>
  
  <p>I found out a way to execute this stored procedure without parameters online using try catch:</p>
  
  <pre><code>async function getDataFromProcedure(dbConfig, procedureName) {
    try {
      await sql.connect(dbConfig);
      const request = new sql.Request();
      recordsets = await request.execute(procedureName);
      return recordsets[0];
    } catch (error) {
      // handle error here
    }
  };
  </code></pre>
  
  <p>How do I add parameters to the stored procedure using try catch?</p>