본문 바로가기

IT

Inport/Export Data from another database/file

BULK INSERT MyTableName FROM 'C:\TargetFile.csv'
WITH (FIELDTERMINATOR = ',');

SELECT * 
INTO DestinationDB..MyDestinationTable 
FROM SourceDB..MySourceTable 
It will not copy constaints, defaults or indexes. The table created will not have a clustered index.

Alternatively you could:
INSERT INTO DestinationDB..MyDestinationTable 
SELECT * FROM SourceDB..MySourceTable