I am executing a very big (3 gigabytes) SQL file via the command line. It is too big to be opened in the SQL Server Management Studio. After several minutes, the tool returns a syntax error.
Msg "102", Level "15", State "1", Server "XYZ\XYZ", Line 20 "Unclosed
quotation mark after the character string "text3
"."
Please note the line break after "text3
!
My question is: How can I find the location of the error?
I need to somehow search the big file. Preferarbly with vim
. However, I have no idea how to look for that error. The text text3
appears many times in the file. As said, I cannot open the file in the SQL Server Management Studio. The error is also not in Line 20. So I am not sure what that Line 20
in the error message even means? Maybe I can somehow make use of that line break.
if you have big file with small batches you will launch SQL Server Profiler (SSMS Menu Tools) choose Events about Errors and Profiler catch text of batch with error. And you can find bad batch.