I need to import a csv file into sql server table, but i only want to import the first 1000 records of the csv file.
This is my sql code,
USE MyDB
BULK INSERT MyTable
FROM 'C:\Users\jasons\Desktop\Documents\MyFile.csv'
WITH(
FIRSTROW = 2,
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
What do i need to add or how can i change my code to only import the first 1000 records.
USE MyDB
BULK INSERT MyTable
FROM 'C:\Users\jasons\Desktop\Documents\MyFile.csv'
WITH(
FIRSTROW = 2,
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n',
LASTROW = 1001
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With