Simple T-SQL to copy table from one database to another

Just when you feel you have learned all the basics you come across something so simple.  Copy a table and its contents from one database to another is as simple as the code below:

SELECT *
INTO database2.dbo.tblTest
FROM database1.dbo.tblTest

Note that this is done on the same sql server and that it does not copy indexes. Anything else I should know?

del.icio.us Digg StumbleUpon Facebook Google Bookmarks DZone
| View count: 6468
blog comments powered by Disqus