Computer Science, asked by teaquestion2300, 1 year ago

What is stored procedure ? Give syntax to create stored procedure.

Answers

Answered by avni99
0

✌What is stored procedure ✌

A stored procedure is a collection and set of sql statements and sql command logic which is compiled and stored in the database. A stored procedure is one kind of database object which is available under programmability section

✌create stored procedure ✌

1.In Object Explorer, connect to an instance of Database Engine and then expand that instance.

2.Expand Databases, expand the AdventureWorks2012 database, and then expand Programmability.

3.Right-click Stored Procedures, and then click New Stored Procedure.

4.On the Query menu, click Specify Values for Template Parameters.

5.In the Specify Values for Template Parameters dialog box, enter the following values for the parameters shown.

6.Click OK.

7.In the Query Editor, replace the SELECT statement with the following statement

8.To test the syntax, on the Query menu, click Parse. If an error message is returned, compare the statements with the information above and correct as needed.

9.To create the procedure, from the Query menu, click Execute. The procedure is created as an object in the database.

10.To see the procedure listed in Object Explorer, right-click Stored Procedures and select Refresh.

11.To run the procedure, in Object Explorer, right-click the stored procedure name HumanResources.uspGetEmployeesTest and select Execute Stored Procedure.

12.In the Execute Procedure window, enter Margheim as the value for the parameter @LastName and enter the value Diane as the value for the parameter @FirstName.

Hope its help u

Mark me as a brainlist...

Similar questions