How to Initialize the Inputs in the SQL
SQL Server allows you to provide input to a stored procedure, so your stored procedures produce dynamic information. The input variables are set in your stored procedures, and you must initialize the input variables by adding them to your stored procedure calls in SQL Server Management Studio. If you do not send values, the stored procedure uses the default values.
Instructions
-
-
1
Click the Windows "Start" button and type "sql management studio" in the search text box. Press "Enter" to open the database software.
-
2
Log in to your SQL Server in the first login screen. After the server loads in Management Studio, click the database on which you want to execute the commands.
-
-
3
Click "New Query" to open the SQL editor. Type the code to initiate your stored procedure input values. For instance, the following stored procedure statement calls a stored procedure that sets up the customer ID and retrieves the customer information:
exec sp_getCustomer @id=111
The "@id" is the input parameter you send to the stored procedure. Separate each input parameter with a comma.
-
4
Press the "F5" key to execute the code. The results of the query are displayed at the bottom of the window.
-
1