1

While inserting bulk data in sqlserver with query

BULK INSERT Table_name
FROM 'FilePath'
WITH 
( FIELDTERMINATOR ',',
ROWTERMINATOR '\n')
;  

I'm getting error

"Incorrect syntax near '('."

I don't see an error in the above statement - could someone please help?

closed as off-topic by Michael Green, dezso, RLF, MDCCL, Erik Feb 24 '17 at 16:03

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Too localized - this could be because your code has a typo, basic error, or is not relevant to most of our audience. Consider revising your question so that it appeals to a broader audience. As it stands, the question is unlikely to help other users (regarding typo questions, see this meta question for background)." – Michael Green, dezso, RLF, MDCCL, Erik
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Is this the only statement, or there is something before it? – dezso Feb 24 '17 at 10:06
2

Looking at the BULK INSERT documentation, it shows that the syntax should be:

BULK INSERT Table_name
FROM 'FilePath'
WITH 
( FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n')
;  

ie, with = signs between the option name and the value.

Not the answer you're looking for? Browse other questions tagged or ask your own question.