How to create a script in SQL Management Studio 2005?

I have a table in db MS SQL Server. I want to create a script that will put a table and all records in another db. So I right-clicked on the table in Management Studio and select Create-To new query editor ... but all I get is the table structure.

How to get the values ​​exactly?

+3
source share
4 answers

One of the things that I really like about the tools for MySQL that SQL Server is missing is to be sure.

You can use a script to do this .

+3
source

- Red-Gate SQL Compare Red-Gate. 395 ( ), 14- , SQL Server .

+3

( , ) script, , , :

INSERT INTO [destinationdb].[dbo].[destinationtable] SELECT * 
FROM [originaldb].[dbo].[originaltable]

( [_] , )

xp_cmdshell ( , ) bcp , /. xp_cmdshell , .

+2

"SQL script", :

  • /

  • " " .

  • , .dtsx

  • (he will take care of security and will not cost another penny, it seems we need to compete with other answers :))

hope this helps.

+1
source

Source: https://habr.com/ru/post/1698660/


All Articles