-1

copying non-matched rows from one database to another database

I have tried this:

insert into pharmsql.[dbo].[SettingDetail] 
select * from PharmSQL_bkp.dbo.SettingDetail
SS_DBA
  • 2,403
  • 1
  • 11
  • 15
mohd tousif
  • 11
  • 1
  • 1
  • 2

1 Answers1

1

Use the database where you you need to insert and pull from the source Database as follows.

INSERT INTO dbo.TargetTable(field1, field2, field3)
   SELECT field1, field2, field3
     FROM SourceDatabase.dbo.SourceTable
     WHERE (some condition)
Rakesh
  • 11
  • 3