Search Results:

Tuesday, June 30, 2009

Sql Problem.

Hi Friends,

Today i have experienced a wierd problem with the stored procedure on my Sql server 2005. The stored procedure works fine for some time and later on it gives me a time out.But when i try to recompile the stored procedure it works fine. I thought to find a permanent solution for this. I have found some solution which works for now. I have to check if this problem is solved or it still persists.
I will update the blog if this worked.

1)DBCC FREEPROCCACHE --this flushes out the procedure caches
2)DBCC FLUSHPROCINDB (dbid) --recompiles all SPs in the database

In order to get the dbid we can use a simple select statement as shown below.


SELECT DB_ID('databasename') as [Database ID].

**Keep checking the blog for updates.

1 comment: