locked
Host-file columns may be skipped only when copying into the Server RRS feed

  • Question

  •  

    The foll BCP command works fine on SQL SERVER 2000 and create the file with the expected resultset

     

    bcp "exec DEVDB..SPROC_MYPROC 'Jul  1 2008 12:00AM' ,'Jul  1 2008 11:59PM' , 2 " queryout "E:\MYPROC_OUTPUT.txt" -T -S TESTDB -c -t"|"

    But when the same command is run on SQL SERVER 2005 (SP2)   (version 9.00.3257.00 ),

    it gives the foll error

     

    SQLState = S1000, NativeError = 0
    Error = [Microsoft][SQL Native Client]Host-file columns may be skipped only when copying into the Server

    I am NOT specifying any out-put file format but the error seems to indicate a mismatch between an out-put file format and the actual out-put.

     

    Any help on the issue would be greatly appreciated.
    Friday, July 11, 2008 11:32 AM

Answers

  • Can you try and run it with set fmtonly off before the stored procedure call like this:

     

    bcp "set fmtonly off exec DEVDB..SPROC_MYPROC 'Jul  1 2008 12:00AM' ,'Jul  1 2008 11:59PM' , 2 " queryout "E:\MYPROC_OUTPUT.txt" -T -S TESTDB -c -t"|"

    Saturday, July 12, 2008 4:35 PM

All replies

  • Can you try and run it with set fmtonly off before the stored procedure call like this:

     

    bcp "set fmtonly off exec DEVDB..SPROC_MYPROC 'Jul  1 2008 12:00AM' ,'Jul  1 2008 11:59PM' , 2 " queryout "E:\MYPROC_OUTPUT.txt" -T -S TESTDB -c -t"|"

    Saturday, July 12, 2008 4:35 PM
  • It worked for me... :) thanks Jon.
    Cheers, Pranav
    Wednesday, October 28, 2009 5:30 AM