Check out example codes for "sql select data from one database and insert into a different database". It will help you in understanding the concepts better.

Code Example 1

USE TargetDatabase
GO

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

Learn ReactJs, React Native from akashmittal.com