Announcement

Collapse
No announcement yet.

xp_cmdshell and bc2.exe

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • xp_cmdshell and bc2.exe

    When I run this statement from SQL Server Query Analyzer, it just hangs. Is there a trick to running bc2.exe from xp_cmdshell? Xp_cmdshell works fine otherwise

    EXEC master.dbo.xp_cmdshell 'c:\temp\bc2.exe /silent @pubs8.5.7_9.0.0.txt'

    Thanks,
    Prockness

  • #2
    Re: xp_cmdshell and bc2.exe

    Prockness and I discussed this by email.

    It looks like the problem is that T-SQL treats the @ character as part of a variable name. At this point we haven't found a workaround to the problem.

    If anyone else monitoring this thread has T-SQL experience and has a suggestion that might help, please let us know.
    Chris K Scooter Software

    Comment


    • #3
      Re: xp_cmdshell and bc2.exe

      I am new to BC, but after reviewing some of the other posts on here, I found a way to make xp_cmdshell run. You have to trick it. The best way to trick it is with a Windows batch (bat) file. Here is an example of what I did:

      --Batch file contents
      e:\progra~1\beyond~1\bc2.exe @e:\ss2k5\sql_script_compare.txt

      -- T-SQL statement
      exec master..xp_cmdshell 'e:\ss2k5\bc2.bat'


      I created my BC2 script file and then created a batch file that wraps the BC commands. It ran without issue; the BC file even created an HTML report for me.

      Hope this helps,
      Carey

      Comment

      Working...
      X