dcsimg
www.webdeveloper.com
Results 1 to 6 of 6

Thread: Execute SQL Server Stored Procedure

  1. #1
    Join Date
    Jan 2006
    Posts
    143

    Execute SQL Server Stored Procedure

    Can I use Javascript to execute a stored procedure in SQL Server?

    If yes, what would the connection string look like and the command?

    If no, what is the easiest way to execute a stored procedure from a HTML page?

    Can I use Javascript to execute a bat file?

  2. #2
    Join Date
    May 2003
    Location
    Between Baltimore and DC
    Posts
    3,579
    Why would you open yourself up to attack like that? You need to use a serverside language to do it. Pick your flavor from php, Java, .NET, ASP, ColdFusion, etc.

    Eric

  3. #3
    Join Date
    Dec 2004
    Posts
    8,637
    Quote Originally Posted by swtrans
    Can I use Javascript to execute a stored procedure in SQL Server?
    Direct from JavaScript, no. But you can use Ajax, in combination with a server-side language, to achieve the same result. Ajax is related to JavaScript in much the same way as is DHTML. Try a Google search on Ajax and JavaScript.

  4. #4
    Join Date
    May 2012
    Posts
    3

    How to execute an Oracle stored procedure from JAVASCRIPT

    Yes you can execute an Oracle stored procedure from JAVASCRIPT. Execute the following JAVASCRIPT:

    var query = ADO.CreateADOQuery();
    query["ConnectionString"] = getConnectionString();
    query.SQL='begin package_name.procedure_name(parameter_list); end;';
    query.ExecSQL();

    You can substitute any anonymous PLSQL block in the query.SQL line in the above example.

  5. #5
    Join Date
    May 2012
    Posts
    3
    Quote Originally Posted by A1ien51 View Post
    Why would you open yourself up to attack like that? You need to use a serverside language to do it. Pick your flavor from php, Java, .NET, ASP, ColdFusion, etc.

    Eric
    There are legitimate reasons why someone might want to do this. Like writing a TestComplete script in JavaScript.

  6. #6
    Join Date
    May 2012
    Posts
    3
    There are legitimate reasons to do this like writing a TestComplete script in JavaScript

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles