Created
August 28, 2017 07:59
-
-
Save SafeerH/e536d8f7a63cf01d7bfa497b0eae790d to your computer and use it in GitHub Desktop.
Copy table data between databases
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET IDENTITY_INSERT [mydb_to].dbo.[A] ON | |
INSERT INTO [mydb_to].dbo.[A]( col1, col2, col3, ..., coln ) --List the names of columns | |
SELECT * FROM [mydb_from].dbo.[A] WHERE reqid = 201 | |
SET IDENTITY_INSERT [mydb_to].dbo.[A] OFF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment