Problem with xp_cmdshell - URGENT

  • Hi,

    I am trying to execute a batch file (which will create a tab delimited file at specified location)  by using xp_cmdshell.  I am getting the result as follows:

    NULL

    C:\WINNT\system32>Set Server="MAHESH"

    NULL

    C:\WINNT\system32>Set Database=TEST

    NULL

    C:\WINNT\system32>Set SSTPrimary=H:\TESTSHARE\

    NULL

    C:\WINNT\system32>SET log=H:\TESTSHARE\TEST

    NULL

    C:\WINNT\system32>osql -S "MAHESH" -d TEST /E /Q

    NULL

    C:\WINNT\system32>pause

    NULL

    C:\WINNT\system32>bcp "Select * from users" queryout H:\TESTSHARE\Test.tb2 -c -S"MAHESH"  -T

    NULL

    Starting copy...

    NULL

    0 rows copied.

    Network packet size (bytes): 4096

    Clock Time (ms.): total        1

    NULL

    C:\WINNT\system32>pause

    Press any key to continue . . .

    NULL

    And the files created with 0 KB.  What is the problem ?

     

    NOTE: If i execute that batch file manually, file is created properly with data.

     

    Thanks,

    Mahesh

  • please see posts to same question at:

    http://www.sqlservercentral.com/forums/post.aspx?forumid=145&messageid=152133



    Good Hunting!

    AJ Ahrens


    webmaster@kritter.net

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

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