Will TSQL return faster results than stored procedure in SQL Server

后端 未结 2 1339
星月不相逢
星月不相逢 2021-01-22 03:11

I have a stored procedure that works fine previously. It took 4 to 5 secs to get the results.

I didn\'t used this stored procedure for the past two months. When I call

2条回答
  •  南笙
    南笙 (楼主)
    2021-01-22 03:51

    You may have bad execution plan associated with that proc. Try this one

    DBCC FREESYSTEMCACHE ('ALL') WITH MARK_IN_USE_FOR_REMOVAL;
    

    You may also find this interesting to read http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html

提交回复
热议问题