
Error BCP
Publicado por Jacobo (6 intervenciones) el 13/11/2015 11:36:01
Hola a todos.
Os pongo en situacion para ver si me podeis ayudar.
Tenia instalado el SQL Server 2008 y ejecutaba bcp de este tipo:
BCP "DECLARE @colnames VARCHAR(max);SELECT @colnames = COALESCE(@colnames + char(9), '') + column_name from PRUEBA.INFORMATION_SCHEMA.COLUMNS where TABLE_NAME='Ubicaciones'; select @colnames;" queryout HeadersOnly.txt -c -t \t -r 0x0a -T -C
BCP PRUEBA.dbo.Ubicaciones out TableDataWithoutHeaders.txt -c -t \t -r 0x0a -T -C
copy /b HeadersOnly.txt+TableDataWithoutHeaders.txt Ubicaciones.txt
del HeadersOnly.txt
del TableDataWithoutHeaders.txt
y me funcionaba perfectamente.
Me dieron una base de datos que no podia abrir con el 2008 asi que desinstalé el 2008 y puese el 2012.
Al intentar ejecutar el mismo proceso de BCP me sale el siguiente error:
SQLState = S0002, NativeError = 208
Error = [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Invalid object nam
e 'prueba.dbo.Ubicaciones'.
SQLState = 37000, NativeError = 11529
Error = [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]The metadata could
not be determined because every code path results in an error; see previous err
ors for some of these.
Me extrae correctamente la cabecera de la tabla pero no me extrae los datos.....
Me podeis
Os pongo en situacion para ver si me podeis ayudar.
Tenia instalado el SQL Server 2008 y ejecutaba bcp de este tipo:
BCP "DECLARE @colnames VARCHAR(max);SELECT @colnames = COALESCE(@colnames + char(9), '') + column_name from PRUEBA.INFORMATION_SCHEMA.COLUMNS where TABLE_NAME='Ubicaciones'; select @colnames;" queryout HeadersOnly.txt -c -t \t -r 0x0a -T -C
BCP PRUEBA.dbo.Ubicaciones out TableDataWithoutHeaders.txt -c -t \t -r 0x0a -T -C
copy /b HeadersOnly.txt+TableDataWithoutHeaders.txt Ubicaciones.txt
del HeadersOnly.txt
del TableDataWithoutHeaders.txt
y me funcionaba perfectamente.
Me dieron una base de datos que no podia abrir con el 2008 asi que desinstalé el 2008 y puese el 2012.
Al intentar ejecutar el mismo proceso de BCP me sale el siguiente error:
SQLState = S0002, NativeError = 208
Error = [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Invalid object nam
e 'prueba.dbo.Ubicaciones'.
SQLState = 37000, NativeError = 11529
Error = [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]The metadata could
not be determined because every code path results in an error; see previous err
ors for some of these.
Me extrae correctamente la cabecera de la tabla pero no me extrae los datos.....
Me podeis
Valora esta pregunta


0