SCENARIO
Suppose you have a table with some data in a Database A and you want to copy this data to a table in Database B .
then you should use the following syntax:
Suppose you have a table with some data in a Database A and you want to copy this data to a table in Database B .
then you should use the following syntax:
USE DatabaseB;
SELECT *
INTO NewTable
FROM DatabaseA.Schemaname.OldTable
Here NewTable and OldTable are two similar tables in different databases.
While handling different databases we must use fully qualified names
to reach correct tables.