Saturday, July 23, 2016

What is the stored procedure?



Stored procedure are the group of SQL statement which run all the SQL statement in a single unit it is precompiled object if we call to stored procedure then there is no need to compile again.

Example of the stored procedure is given below:

Firstly we create a table with the name emp


Then create stored procedure:
create procedure abc(@id int, @nm varchar(20),@s1 int)
as
insert into emp values(@id, @nm, @s1)
return

After execute the above code we insert data into table by using the following syntax

exec abc 6,'Abi',22000


Output: 



 


No comments:

Post a Comment