Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

INSERTING MULTIPLE ROWS FROM ANOTHER TABLE

Status
Not open for further replies.

bgreenhouse

Technical User
Joined
Feb 20, 2000
Messages
231
Location
CA
Hi Everyone

I'm trying to make a SQL Statement that will be a step in a job. What I'm trying to do is insert all the rows in a temporary table into a permanent table that has the exact same structure as the temporary table (just append them on the end I guess). I know how to do this in ASP, I'd just create a recordset of all the fields in the temp table, and then loop through each record, and insert it into the permanent table each loop. Unfortunately, you can't use VBScript in a TSQL step in a job. Any ideas (either a TSQL statement, or an alternative)?

Thanks

Ben
 
INSERT perm_table
SELECT * FROM #TempTable
 
Thanks Balves...I figured that out pretty much right after I posted the question...Must not have had enough coffee this morning...I was trying to put the VALUES part in...

Ben
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top