Friday, 23 June 2017

Copy SQL tables in to new data base



I have a SQL DB name Test
table names are Tbl_1, Tbl_2
Now i would like to create new DB with same tables from Test

Create new DB Test_Copy
Create new query from Test_Copy DB
Now run below query to create tables with data

 select * into [dbo].[Tbl_1] from [Test].[dbo].[Tbl_1]
 select * into [dbo].[Tbl_2] from [Test].[dbo].[Tbl_2]