Problema con OSQL

17/01/2008 - 12:59 por Cristian Meneses | Informe spam
Buenas
Tengo un problema al ejecutar OSQL sobre SQL 2005.. desde linea de
comandos se ejecuta bien, pero desde un programa hecho en vb usando
comando Shell no.
Uso: OSQL -E -S -i C:\update.sql -o c:\log.txt

El error que me da en el log.txt es este:
1> 2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12> 13> 14> 15> 16> 17> 18> 19> 20>
21> 22> 23> 24> 25> 26> 27> 28> 29> 30> 31> 32> 33> 34> 35> 36> 37>
38> 39> 40> 41> 42> 43> 44> 45> 46> 47> 48> 49> 50> 51> 52> 53> 54>
55> 56> 57> 58> 59> 60> 61> 62> 63> 64> 65> 66> 67> 68> 69> 70> 71>
72> 73> 74> 75> 76> 77> 78> 79> 80> 81> Mensaje 102, Nivel 15, Estado
1, Servidor 6737E3093E0D450\SQLEXPRESS, Línea 1
Sintaxis incorrecta cerca de '0x0a0d'.
Mensaje 102, Nivel 15, Estado 1, Servidor 6737E3093E0D450\SQLEXPRESS,
Línea 19
Sintaxis incorrecta cerca de '0x0a0d'.
Mensaje 102, Nivel 15, Estado 1, Servidor 6737E3093E0D450\SQLEXPRESS,
Línea 21
Sintaxis incorrecta cerca de '0x0a0d'.
Mensaje 102, Nivel 15, Estado 1, Servidor 6737E3093E0D450\SQLEXPRESS,
Línea 23
Sintaxis incorrecta cerca de '0x0a0d'.
Mensaje 102, Nivel 15, Estado 1, Servidor 6737E3093E0D450\SQLEXPRESS,
Línea 35
Sintaxis incorrecta cerca de '0x0a0d'.
Mensaje 102, Nivel 15, Estado 1, Servidor 6737E3093E0D450\SQLEXPRESS,
Línea 37
Sintaxis incorrecta cerca de '0x0a0d'.
Mensaje 102, Nivel 15, Estado 1, Servidor 6737E3093E0D450\SQLEXPRESS,
Línea 41
Sintaxis incorrecta cerca de '0x0a0d'.
Mensaje 102, Nivel 15, Estado 1, Servidor 6737E3093E0D450\SQLEXPRESS,
Línea 49
Sintaxis incorrecta cerca de '0x0a0d'.
Mensaje 102, Nivel 15, Estado 1, Servidor 6737E3093E0D450\SQLEXPRESS,
Línea 51
Sintaxis incorrecta cerca de '0x0a0d'.
Mensaje 102, Nivel 15, Estado 1, Servidor 6737E3093E0D450\SQLEXPRESS,
Línea 53
Sintaxis incorrecta cerca de '0x0a0d'.
Mensaje 111, Nivel 15, Estado 1, Servidor 6737E3093E0D450\SQLEXPRESS,
Línea 71
'ALTER FUNCTION' debe ser la primera instrucción en un lote de
consultas.
Mensaje 102, Nivel 15, Estado 1, Servidor 6737E3093E0D450\SQLEXPRESS,
Línea 81
Sintaxis incorrecta cerca de '0x0a0d'.
Mensaje 137, Nivel 15, Estado 2, Servidor 6737E3093E0D450\SQLEXPRESS,
Línea 83
Debe declarar la variable escalar "@IDCALENDARIO".
Mensaje 102, Nivel 15, Estado 1, Servidor 6737E3093E0D450\SQLEXPRESS,
Línea 85
Sintaxis incorrecta cerca de '0x0a0d'.

Averigue en google, y microsoft hace referencia a un problema de
compatibilidad y aconseja usar
EXEC sp_dbcmptleve 'Mibasedatos', 90

Lo ejecute, reinicie el servidor y sigue todo igual.
Muchas gracias de antemano.
Saludos


Cristian Meneses
 

Leer las respuestas

#1 Jesús López
17/01/2008 - 13:25 | Informe spam
Eso tiene pinta de un problema de codificación de caracteres. Prueba a
cambiar la codificación de Update.sql a ANSI y a UNICODE.

Saludos:

Jesús López
www.soldiq.com



"Cristian Meneses" escribió en el mensaje
news:
Buenas
Tengo un problema al ejecutar OSQL sobre SQL 2005.. desde linea de
comandos se ejecuta bien, pero desde un programa hecho en vb usando
comando Shell no.
Uso: OSQL -E -S -i C:\update.sql -o c:\log.txt

El error que me da en el log.txt es este:
1> 2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12> 13> 14> 15> 16> 17> 18> 19> 20>
21> 22> 23> 24> 25> 26> 27> 28> 29> 30> 31> 32> 33> 34> 35> 36> 37>
38> 39> 40> 41> 42> 43> 44> 45> 46> 47> 48> 49> 50> 51> 52> 53> 54>
55> 56> 57> 58> 59> 60> 61> 62> 63> 64> 65> 66> 67> 68> 69> 70> 71>
72> 73> 74> 75> 76> 77> 78> 79> 80> 81> Mensaje 102, Nivel 15, Estado
1, Servidor 6737E3093E0D450\SQLEXPRESS, Línea 1
Sintaxis incorrecta cerca de '0x0a0d'.
Mensaje 102, Nivel 15, Estado 1, Servidor 6737E3093E0D450\SQLEXPRESS,
Línea 19
Sintaxis incorrecta cerca de '0x0a0d'.
Mensaje 102, Nivel 15, Estado 1, Servidor 6737E3093E0D450\SQLEXPRESS,
Línea 21
Sintaxis incorrecta cerca de '0x0a0d'.
Mensaje 102, Nivel 15, Estado 1, Servidor 6737E3093E0D450\SQLEXPRESS,
Línea 23
Sintaxis incorrecta cerca de '0x0a0d'.
Mensaje 102, Nivel 15, Estado 1, Servidor 6737E3093E0D450\SQLEXPRESS,
Línea 35
Sintaxis incorrecta cerca de '0x0a0d'.
Mensaje 102, Nivel 15, Estado 1, Servidor 6737E3093E0D450\SQLEXPRESS,
Línea 37
Sintaxis incorrecta cerca de '0x0a0d'.
Mensaje 102, Nivel 15, Estado 1, Servidor 6737E3093E0D450\SQLEXPRESS,
Línea 41
Sintaxis incorrecta cerca de '0x0a0d'.
Mensaje 102, Nivel 15, Estado 1, Servidor 6737E3093E0D450\SQLEXPRESS,
Línea 49
Sintaxis incorrecta cerca de '0x0a0d'.
Mensaje 102, Nivel 15, Estado 1, Servidor 6737E3093E0D450\SQLEXPRESS,
Línea 51
Sintaxis incorrecta cerca de '0x0a0d'.
Mensaje 102, Nivel 15, Estado 1, Servidor 6737E3093E0D450\SQLEXPRESS,
Línea 53
Sintaxis incorrecta cerca de '0x0a0d'.
Mensaje 111, Nivel 15, Estado 1, Servidor 6737E3093E0D450\SQLEXPRESS,
Línea 71
'ALTER FUNCTION' debe ser la primera instrucción en un lote de
consultas.
Mensaje 102, Nivel 15, Estado 1, Servidor 6737E3093E0D450\SQLEXPRESS,
Línea 81
Sintaxis incorrecta cerca de '0x0a0d'.
Mensaje 137, Nivel 15, Estado 2, Servidor 6737E3093E0D450\SQLEXPRESS,
Línea 83
Debe declarar la variable escalar "@IDCALENDARIO".
Mensaje 102, Nivel 15, Estado 1, Servidor 6737E3093E0D450\SQLEXPRESS,
Línea 85
Sintaxis incorrecta cerca de '0x0a0d'.

Averigue en google, y microsoft hace referencia a un problema de
compatibilidad y aconseja usar
EXEC sp_dbcmptleve 'Mibasedatos', 90

Lo ejecute, reinicie el servidor y sigue todo igual.
Muchas gracias de antemano.
Saludos


Cristian Meneses

Preguntas similares