Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 SQL Handles
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

1 Posts

Posted - 01/07/2013 :  10:04:24  Show Profile  Reply with Quote

I'm looking for information on how SQL handles for database objects are generated.

According to Microsoft, "...database objects such as stored procedures, triggers or functions, the SQL handles are derived from the database ID, object ID, and object number."

Could anybody offer any more insight? Specifically, one thing I have noticed is that if a stored procedure is executed, a plan handle with a given SQL handle will be cached, and all subsequent plans for that procedure will have the same SQL handle, for as long as at least one of those plans remains in the cache. If all plans for a given SQL handle are cleared from the cache, and the same stored procedure (with the exact same text, object id, etc) is executed, the newly cached plan will have a different, but very similar, SQL handle.

I am curious what factor differentiates the SQL handle. According to my understanding, the SQL handles should be identical, but clearly that is not the case. Any insight would be greatly appreciated!

Thanks in advance :)
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000