SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    Non-Member
    Join Date
    Jul 2008
    Posts
    221
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to call sql stored procedure in asp

    Hello,

    I created a stored procedure in sql server and it worked when I called from sql QA (exec sp_name)

    When I applied this to asp as:

    sql = select * from tbl_student
    where student_id in (exec dbo.sp_name)

    It generated syntax error.

    How do I call a stored procedure in asp? Or what is another way to make it work?

    Thanks.

  2. #2
    SitePoint Member
    Join Date
    Sep 2010
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Make sure your SPROC's are created correctly and that they can be executed correctly. They should execute as caller.

    and for the asp side of things:
    How to call SQL Server stored procedures from ASP

    have fun!

  3. #3
    Non-Member
    Join Date
    Jul 2008
    Posts
    221
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    good tips.
    thanks for that link.

  4. #4
    SitePoint Member
    Join Date
    Jan 2013
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    set con = Server.CreateObject("ADODB.Connection")
    con.Open strConnect
    Set Comm = Server.CreateObject("ADODB.Command")
    comm.ActiveConnection = con
    comm.CommandText = "SP_NAME"
    comm.CommandType = adCmdStoredProc
    comm.Execute

    <snip/>
    Last edited by Mittineague; Jan 8, 2013 at 01:38. Reason: removing unnecessary link


Bookmarks

Posting Permissions

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