Calling VBScript or command file from within T-SQL without xp_cmdshell??

  • Hi

    Can someone give me a hint if it's, in any way, possible to call up a vbscript without using xp_cmdshell....and in that case how to do it

    Regards

    H

  • If you have VB, you could convert the script to a CLR... I'm sure there's other ways, but I don't know what they are.

    What I'd be more interested in finding out is what the VB Script does... chances are, there just might be a way to do the same thing without the VB Script.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • As Jeff said, chances are whatever you were going to do, you could do it in tSQL;

    outside of that, you can use sp_OACreate to run vbscripts, or an executable, or call a dll...it depends on what you wanted to try and do.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Thanks for the answers....

    I think I might have found the solution for the vbscript part...but still one big thing remains..to be able to call up BCP utility command for bulk copy from within a stored procedure. I want to generate an xml based output file from some tables in my database (runtime) and for that part I have also used xp_cmdshell....any ideas how to replace that xp_cmdshell call for BCP at runtime ?

    br

    H

  • You still haven't answered my question... what does the VB Script do? Also, which direction is the BCP in?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 5 posts - 1 through 4 (of 4 total)

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