0

I am currently trying to use Command Prompt to run a sql file in order to load its data to our sql data base. We are using SQL server as tool but use sqlcmd to load data this time as this file is pretty big, which is over 2.5 gb.

However, after I simply use cmd such as:

sqlsmd -S S5V....(my server name) -d ...(my db name) -i...(my file address)

to insert data, I got the issue below:

Msg 102, Level 15, State 1, Server S5V251DNASQL001, Line 45 Incorrect syntax near '0x504b030414000600080000002100348bb94cbb010000a3090000130008025b436f6e74656e745f54797065735d2e786d6c20a2040228a00002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'.

My question therefore is, can I just skip this line and continue load the rest of the data? Or is there anyway to skip or ignore this problematic line? Or any other idea to debug this issue?

Bohemian
  • 412,405
  • 93
  • 575
  • 722
  • I tried add -b and -V in my sqlcmd but still got same issue – leon_resident May 16 '22 at 07:20
  • 1
    You probably want to rethink how you are loading this data. Perhaps use a backup/restore or maybe `bcp` – Charlieface May 16 '22 at 08:26
  • The linked thread describes to what extent runtime-errors can (or cannot) be handled. I don't think you can run a script with _syntax errors_. If you somehow generate the script file, you need to look at that step and make sure it produces a valid script. – KekuSemau May 16 '22 at 08:26
  • Hi guys. really appreciate your guys suggestion. In the end we just find this problem can not be ignored so we asked our vendor to resend data. – leon_resident May 24 '22 at 07:59

0 Answers0