SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

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

dataflow
Starting Member

1 Posts

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

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  
 New 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.03 seconds. Powered By: Snitz Forums 2000