MSSQLExecute SQL Fails with Unicode Scripts

When a SQL script is created with a file format of Unicode the script fails with an error

Msg 156, Level 15, State 1, Server NYCINTSQL01, Procedure fnParseField, Line 29
Incorrect syntax near the keyword 'SET'.
1> 2>
Execute failed, return code: 1

SQL2005 only creates files in Unicode format

 


 

Hi Jody,

I was not able to reproduce the problem here when executing a Unicode encoded script against a SQL 2005 database, using the SqlCmd tool.

Which version of SQL Server are you executing the SQL Script on, and which SQL Server Tool are you using? (ISQL, OSQL or SqlCmd).

Regards,
Paul.

Paul,

This error occurs with when running a script against a SQL2000 database using the ISQL Server Tool.

Jody

 

Hi Jody,

The ISQL tool does not support Unicode input files. Either OSql or SqlCmd should work without a problem.

Regards,

Angus