I am copying the data from one data base to another database with similar table structures. One table has an identity column, and I am able to copy the data with IDENTITY_INSERT on but the problem is I need to mention all the column names in the insert statment.
Is there any way I can copy data from one table to another without mentioning any column names, since the table strucutes are same.
Right now I am doing like this
SET IDENTITY_INSERT NEWDB.table1 ON
INSERT INTO NEWDB.blah1
(ID,col1,col2)
select ID,col1,col2 from OLDDB.blah1
but if I like to do something like this
Insert into NEWDB.blah1
select * from OLDDB.blah1
Any ideas?
Thanks,
Is there any way I can copy data from one table to another without mentioning any column names, since the table strucutes are same.
Right now I am doing like this
SET IDENTITY_INSERT NEWDB.table1 ON
INSERT INTO NEWDB.blah1
(ID,col1,col2)
select ID,col1,col2 from OLDDB.blah1
but if I like to do something like this
Insert into NEWDB.blah1
select * from OLDDB.blah1
Any ideas?
Thanks,