Simple T-SQL to copy table from one database to another
Filed under SQL Server , T-SQL
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?
| View count: 22209Nov5








