Quantcast
Channel: inSQLServer.com - Script Store
Viewing all articles
Browse latest Browse all 5

Tips: Sample SQL Script demonstrating moving row from one database table to another database table

$
0
0

Many times such requirement comes wherein you need to copy data from one database to another database. Below is the sample sql script demonstrating the same.

You can use a three part qualifier like DatabaseName.Schema.TableName to address a table in a different database.

Use Database1

INSERT INTO Databas2.dbo.TableName
SELECT * FROM Database1.dbo.TableName

You just need to make sure the selected data matches the datatypes in the destination table.

Tags: 


Viewing all articles
Browse latest Browse all 5

Latest Images

Trending Articles





Latest Images