Insert the content of files into a database table.

TRUNCATE TABLE dbo.tbData
GO

BULK
INSERT dbo.tbData
FROM 'D:\file01.csv'
WITH
(
FIELDTERMINATOR = ',',
FIRSTROW = 2,
ROWTERMINATOR = '\n'
)
GO

BULK
INSERT dbo.tbData
FROM 'D:\file02.csv'
WITH
(
FIELDTERMINATOR = ',',
FIRSTROW = 2,
ROWTERMINATOR = '\n'
)
GO

SELECT * FROM dbo.tbData
Last modified: May 27, 2021

Author

Comments

Write a Reply or Comment