Thursday, January 21, 2021

Insert table data from one DB to another DB SQL script

 Insert table data from one DB to another DB SQL script


SQL 1:

INSERT INTO <Target DB>.dbo.<Table Name>

SELECT *

FROM <Source DB>.dbo.<Table Name>

where <Source DB>.dbo.<Table Name>.<Table field name>= '<values>'

 

SQL 2:

INSERT INTO [target db].[dbo].[table] (<columnA>,<columnB>,…)

SELECT <columnA>,<columnB>,…

FROM [source db].[dbo].[table] 

 


No comments:

Post a Comment

Disabling the flight in D365FO (CHD - Tier 1)

 INSERT INTO dbo.SYSFLIGHTING(FLIGHTNAME, ENABLED)  VALUES ('<FlightObjectName>_KillSwitch', 1)  or  INSERT INTO dbo.SYSFLIGHT...