I have two similar tables in two databases. Person_Table1 in DB1 and Person_Table2 in DB2.
I want have a bulk insert from Person_Table1 in DB1 to Person_Table2 on DB2.
Column Names in both tabels is similar. Count of Column in both tables is equal also count of column is many. How can i have a bulk insert like fallowing query:
insert into DB2.dbo.Person_Table2 (*) (SELECT * FROM DB1.dbo.Person_Table1 )
I would always use explicit column names – just to be very clear and safe when doing such an INSERT:
That way, you could also e.g. replace one column in the target table with e.g. a constant value or the value of a SQL function (like
GETDATE()or something)