Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Bulk copying

Author  Topic 

dcarva
Posting Yak Master

140 Posts

Posted - 2005-03-21 : 20:31:48
Hello,

I have a need to take data out of one table (based on date ranges) and move them into another existing table using T-SQL. (archiving) I was using FETCH to accomplish this. Is this the most efficent way to do this via T-SQL? I have to be able to kick this off from a web page. I looked at BCP and BULK INSERT, but it appears that I can only use those to copy to/from a text file and not from a table to a table. Is this correct?

Thanks

dcarva
Posting Yak Master

140 Posts

Posted - 2005-03-21 : 20:44:09
I was just able to do it like this:

INSERT INTO MyTable
SELECT *
FROM otherTable.

That worked great. Not sure if that's the effecient way to copy a table to another existing table using T-SQL.
Go to Top of Page
   

- Advertisement -