SQLCMD ERROR WHILE EXECUTING INSERT STATEMENTS

  • Hi Team,

    I had a requirement of restoring Sql Server 2008 R2 database to Sql Server 2005 server for which I had to use the generate script wizard for the schema along with data.

    Since the sql scritp is too big to be opened and directly executed in SSMS(Since I did not use generate separate file for each object), I had to use sqlcmd utility to load the data. HOwever, since the sqlcmd was failing for one of the databases, I redirected the o/p to a text file and could see the below error

    Command used :sqlcmd -s servername -d mydbname-i D:\temp\table_vw.sql -o E:\temp\output.txt

    :

    (1 rows affected)

    Msg 105, Level 15, State 1, Server <localservername>, Line 77

    Unclosed quotation mark after the character string 'ERROR_REASO

    '.

    Msg 102, Level 15, State 1, Server <localservername>, Line 77

    Incorrect syntax near 'ERROR_REASO

    '.

    Looks like there are some unclosed quotation marks in the insert statement that was generated..

    Can someone please let me know if you have encountered this errror before and if there is a remedy for this particluar issue?

    I have uploaded the error file as well..

    Thanks..

  • It looks like your script is being cut-off. The compplete word in your error message should be "ERROR_REASON" instead of "ERROR_REASO".

    I think you should split the complete script file into two (or more) seperate script files. Then you can determie the right spots yourself to split the file (just between two complete comands), hence prevent errors from an automatic cut-off.

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply