I use sql server 2005 enterprise, windows server 2003.
I try execute osql.exe command, for execute sql file in my server DESSQL:
osql.exe -E -n-1 -i"CarpetaUno\TextFile1.sql"
I get this error:
Msg 102, Level 15, State 1, Server DESSQL, Line 1
Incorrect syntax near 'n'
UPDATE:
I try this too,
osql.exe -E -i"CarpetaUno\TextFile1.sql"
1> 2> Msg 102, Level 15, State 1, Server DESSQL, Line 1
Incorrect syntax near 'n'
Finally, I use SQLCMD command:
SQLCMD -E -b -i"CarpetaUno\TextFile1.sql"
But not works using osql command !!
I test:
1.) using -S ServerName option,
2.) using absolute path: osql.exe -E --i C:\CarpetaUno\TextFile1.sql
3.) TextFile1.sql contents, is OK, I test using SSMS
CREATE DATABASE PRUEBA;
DROP DATABASE PRUEBA;
but I get the same error, in all tests.
Can it fails if I use utf-8 encoding in file ???
any solutions?