Powered By Blogger

Friday, June 20, 2008

how to use the previous stored procedure

It is important to know how to ues a stoped procedure while we get it...
Step 1:
execute this Query
sp_generate_inserts 'Table_Name'
--Type the table name which u want to retrieve ur data from
Then u will get a result...
copy the result and apply it to the desired table...

if there is any identity columns are there in ur table then u may want to insert
Set IDENTITY_INSERT [Table Name] ON
INSERT INTO [Table Name] ([val1],[val2]) VALUES(1,2)
INSERT INTO [Table Name] ([Val1],[Val2]) VALUES (1,2)...
......
......
Set IDENTITY_INSERT [Table Name] OFF

No comments: