Saturday, April 6, 2013

How to insert data in table directly from stored procedure

Question is how to insert data into table directly from stored procedure : you can understand this by simple example

Create table #emp( id int, name varchar(40)
)

Now create stored procedure that return employee info

Create procedure empinfo
Begin
----—---do your logic code—------

Select id,ename from employee
End

Now insert data direcly from stored procedure to table...

Insert into #tmp
Exec empinfo

Note : column return by stored ptocedure must match with table column.

Tag : stored procrdure,sql,sql query.


If you are searching life partner. your searching end with kpmarriage.com. now kpmarriage.com offer free matrimonial website which offer free message, free chat, free view contact information. so register here : kpmarriage.com- Free matrimonial website