Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2004
    Location
    USA
    Posts
    6

    Unanswered: calling vbscript from SP

    I am trying to call a VB script file with the following command,

    xp_cmdshell 'cscript c:\file.vbs'

    But its giving the following output -

    Microsoft (R) Windows Script Host Version 5.1 for Windows
    Copyright (C) Microsoft Corporation 1996-1999. All rights reserved.
    NULL
    Input Error: Can not find script file "c:\file.vbs".
    NULL
    ------------
    If i changed the command to

    xp_cmdshell 'cscript c:file.vbs'

    it gives the folowing error -

    Input Error: Can not find script file "C:\WINNT\system32\file.vbs".


    Actually my main intention is to call a url from the sql server where '
    i can pass some value. Plz let me know if its the right step and whts
    going wrong.

    Thanks & regards,

    -dkoushik

  2. #2
    Join Date
    Aug 2002
    Location
    Scotland
    Posts
    1,578
    How about using XML - http://www.awprofessional.com/articl...02307&seqNum=9 and another possibility is to directly access the ODBC lowlevel APIs directly. I've no exp.using languages like Visual Basic. You may have some luck accessing the stored procedures
    using SQL Namespace APIs & MSEQ.
    --Satya SKJ
    Microsoft SQL Server MVP
    [IMG]http://sqlserver-qa.net/google_bart.gif[/IMG]

  3. #3
    Join Date
    Apr 2004
    Location
    USA
    Posts
    6
    Hi satya,
    Thanks for your reply. But I guess u have misunderstood my question.

    My Actual intention is to call web url from the SqlServe DB.
    I have done the same in oracle. I have used Java stored procedure
    where I have called a web url and the java sp is get called from a
    Oracle function. I am sure there is nothing called java stored proc in Sql server.

    So How can I achive the same result in Sql Server.

    I was just trying some thing using xp_cmdshell (a system SP)
    which can call any VB script which in turn will call the web url.

    Plz help if you have any idea regarding this.

    Thanks & Regards,

    --- dkoushik




    Originally posted by Satya
    How about using XML - http://www.awprofessional.com/articl...02307&seqNum=9 and another possibility is to directly access the ODBC lowlevel APIs directly. I've no exp.using languages like Visual Basic. You may have some luck accessing the stored procedures
    using SQL Namespace APIs & MSEQ.

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    If you are using xp_cmdshell, you've got 90% of the battle won. xp_cmdshell can launch any file that the NT Login used by MS-SQL can see, using whatever tools are available on the machine that is running SQL Server.

    If you can log into the machine that runs your SQL Server, using the same login credentials that SQL Server uses, then you will have almost exactly the same conditions to test with that the xp_cmdshell will run under. Find a command string you can type to get something to happend, and you can then issue the exact same command using xp_cmdshell.

    -PatP

  5. #5
    Join Date
    Apr 2004
    Location
    USA
    Posts
    6
    Hi Pat,

    Thanks for the reply.
    What I understood from your response is ,

    I have to execute the xp_cmdshell in the database server
    query analyzer. I have done the same thing but nothing is happening.

    But this time its not giving any error. But the result its showing as NULL.

    Do have any idea whats happening.

    please help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •