SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 how 2 append data from a stored procedure to table
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Posting Yak Master

230 Posts

Posted - 09/27/2012 :  09:21:15  Show Profile  Reply with Quote
I have a stored procedure named "sprealdata" which has data of 3 columns and around 50,000 rows

Now I would like to append these data into a table.

I already created a table named "realdata" with three columns. Now I want to append the data from stored procedure to the table using query. Of course I can copy and paste but I don't prefer this.

If it is from another table, I would write like this :

insert into realdata 
select * from anothertablename

Flowing Fount of Yak Knowledge

2241 Posts

Posted - 09/27/2012 :  09:28:50  Show Profile  Reply with Quote
INSERT INTO realdate (col1, col2, col3)
EXEC sprealdata

Go to Top of Page

Flowing Fount of Yak Knowledge

8780 Posts

Posted - 09/27/2012 :  09:29:53  Show Profile  Visit webfred's Homepage  Reply with Quote
I don't know the columns but this way:

insert realdata(Col1, Col2, Col3, ...)
exec sprealdata

Too old to Rock'n'Roll too young to die.

Edited by - webfred on 09/27/2012 09:30:35
Go to Top of Page

Posting Yak Master

230 Posts

Posted - 09/27/2012 :  10:40:06  Show Profile  Reply with Quote
Thanks bandi & webfred
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000