bcp and queryout problem

  • hi all,

    im getting SQLState = 28000, NativeError = 18456 error wen i execute the query mentioned below.

    exec master.dbo.xp_cmdshell 'bcp "SELECT * FROM customer for XML auto, ELEMENTS XSINIL" queryout e:\sample.txt -c -T -U"sa" -P"e2s"'

    exec master.dbo.xp_cmdshell 'bcp "SELECT * FROM customer for XML auto, ELEMENTS XSINIL" queryout e:\sample.txt -c -T'

    im getting this problem even after changing the configuration

    config settings

    USE master

    GO

    EXEC sp_configure 'show advanced options', 1

    GO

    RECONFIGURE WITH OVERRIDE

    GO

    EXEC sp_configure 'xp_cmdshell', 1

    GO

    RECONFIGURE WITH OVERRIDE

    GO

    EXEC sp_configure 'show advanced options', 0

    GO

    🙁

    pls help me

    thanks in advance..

  • Hi i think u missed the dbname and owner name please try the following query.

    exec master.dbo.xp_cmdshell 'bcp "SELECT * FROM [dbname].dbo.customer for XML auto, ELEMENTS XSINIL" queryout e:\sample.txt -c -T -U"sa" -P"e2s"'

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply