SQL Server 2005 stored procedure fast in SSMS slow from VBA

后端 未结 4 935
抹茶落季
抹茶落季 2020-12-19 14:48

I have a stored procedure which when run from SQL Server Management Studio consistently takes 5 seconds to run when called like this.

exec dbo.MyStoredProc           


        
4条回答
  •  暖寄归人
    2020-12-19 15:12

    Thanks I'll take a look at the trace tools.

    In reply to the comments on the original question

    Are you using the exact same parameter values?

    Yes exactly the same.

    How much data is being returned (roughly) - number of rows and columns (and are any of them particularly big)?

    Under 200 rows, perhaps 15 fields mostly ints with a couple of 20 character varchars.

    Can you run SQL profiler and confirm if the sql is the issue or the remains of the macro in excel ?

    The SQL is pretty ugly, as is the underlying database schema, and unfortunately is under NDA so I can't post it. If the query were the issue then wouldn't it be slow in management studio too though?

提交回复
热议问题