Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2003
    Location
    Romania
    Posts
    70

    Unanswered: Recordset + StoredProcedure ?

    I use a recordset for a report

    Is a difference between?


    1) To use a stored procedure => return a record set

    cmd.CommandText = "StoredProcedureName"
    cmd.CommandType = adCmdStoredProc
    cmd.Execute


    Or


    2) rs.Open “SELECT * FROM ……”, cn, adOpenStatic, adLockReadOnly


    __________________________
    cn is ADO connection string
    cmd is ADO command
    rs is ADO Recordset

  2. #2
    Join Date
    Dec 2001
    Location
    Canada
    Posts
    45

    Talking

    The Strore procedure was compiled so is fastest. If the execution plan is still in memory they have not waiting time.

    and for the support of your Application if you use at different place your query... with sprocs you need to make de change at only one place...
    Franky
    FBoucheros@hotmail.com

  3. #3
    Join Date
    Jul 2003
    Location
    The Dark Planet
    Posts
    1,401
    Originally posted by Franky
    The Strore procedure was compiled so is fastest. If the execution plan is still in memory they have not waiting time.


    As regarding the execution plan being stored in Memory .. SQL 2000 also stores the exec plans of all the queries and ages them according to a certain algorithm. So there is really not much difference in that regard.
    Get yourself a copy of the The Holy Book

    order has no physical Brett in The meaning of a Kaiser . -database data

  4. #4
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    and for the support of your Application if you use at different place your query... with sprocs you need to make de change at only one place...
    Additionally it is a lot easier to change the stored procedure later on then to change the sql inside your app which would have to be re-compiled and redistributed....

  5. #5
    Join Date
    Oct 2003
    Posts
    8

    Re: Recordset + StoredProcedure ?

    Originally posted by Ovidiu
    I use a recordset for a report

    Is a difference between?


    1) To use a stored procedure => return a record set

    cmd.CommandText = "StoredProcedureName"
    cmd.CommandType = adCmdStoredProc
    cmd.Execute


    Or


    2) rs.Open “SELECT * FROM ?? cn, adOpenStatic, adLockReadOnly


    __________________________
    cn is ADO connection string
    cmd is ADO command
    rs is ADO Recordset
    Hi,
    I got the experience of this kind of executing a stored procedure and returning a recordset in ASP and VB.
    Maybe you can try add this before your last line.
    set rs1 = cmd.execute
    Then the rs1 is what you want to process next step.
    Good lucks

    Mosu

Posting Permissions

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