CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: SQL Server SP

  1. #1
    Join Date
    Aug 2000
    Location
    NY, USA
    Posts
    632

    SQL Server SP

    I have a stored procedure with parameters in SQL Server 2000 database. When I execute it in Enterprise Manager, it takes less than 1 second to return rows.
    When I use it in VB 6 code to populate ADODB.Recordset, it takes more than 30 seconds on this particular line:

    Set rsOrders = cndTemp.Execute

    I'm wondering why is it like that, and how can I make it work with the same
    or at least similar speed in VB?

    Thank you

  2. #2
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Re: SQL Server SP

    Does your application run on a network. Network traffic will determine how loing your SP will take to execute.

    Remember when you are running it directly from the server it doesn't have to send data across to some other layer. That ight be the reason why it runs slower in VB.

  3. #3
    Join Date
    Aug 2000
    Location
    NY, USA
    Posts
    632

    Re: SQL Server SP

    I run both (Query analyzer and VB app) from the same workstation. I'm runing on local database and on the db located on the server. The result is the same. In VB it's 50 times slower.

  4. #4
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Re: SQL Server SP

    Quote Originally Posted by vchapran
    I run both (Query analyzer and VB app) from the same workstation. I'm runing on local database and on the db located on the server. The result is the same. In VB it's 50 times slower.
    Can you shouw us the code?

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured