August 5, 2009 at 8:47 am
Hii
I want to transfer data from table to a text file.I m trying to use bcp utility and xp_cmdshell.but the export is not successful.
My query is:
EXEC master..xp_cmdshell'bcp "Select * from AH_PRE_REQUEST" queryout "c:\dept.txt" -c -T -x'
but erros is..................................
SQLState = S0002, NativeError = 208
Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'AH_PRE_REQUEST'.
SQLState = 37000, NativeError = 8180
Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not be prepared.
NULL
August 5, 2009 at 12:40 pm
polo.csit (8/5/2009)
HiiI want to transfer data from table to a text file.I m trying to use bcp utility and xp_cmdshell.but the export is not successful.
My query is:
EXEC master..xp_cmdshell'bcp "Select * from AH_PRE_REQUEST" queryout "c:\dept.txt" -c -T -x'
but erros is..................................
SQLState = S0002, NativeError = 208
Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'AH_PRE_REQUEST'.
SQLState = 37000, NativeError = 8180
Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not be prepared.
NULL
have you tried including the schema name in your sql expresssion?
EXEC master..xp_cmdshell'bcp "Select * from dbo.AH_PRE_REQUEST" queryout "c:\dept.txt" -c -T -x'
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply