<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-29286778.post859445022467769296..comments</id><updated>2012-02-17T17:26:11.956-05:00</updated><category term='Feature Creeper'/><category term='FAQs and not so FAQs'/><category term='SQL Puzzles'/><category term='Pass time with SQL'/><title type='text'>Comments on SQL Garbage Collector: Parameter Sniffing &amp; Stored Procedures Execution P...</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.sqlpointers.com/feeds/859445022467769296/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default'/><link rel='alternate' type='text/html' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default?start-index=26&amp;max-results=25'/><author><name>Omnibuzz</name><uri>http://www.blogger.com/profile/04342835880399785393</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>49</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-29286778.post-2956175626083986529</id><published>2011-10-11T14:44:01.014-04:00</published><updated>2011-10-11T14:44:01.014-04:00</updated><title type='text'>This article and recommendation/solution saved us ...</title><content type='html'>This article and recommendation/solution saved us a ton of time! Thank you for writing and posting it.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/2956175626083986529'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/2956175626083986529'/><link rel='alternate' type='text/html' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html?showComment=1318358641014#c2956175626083986529' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html' ref='tag:blogger.com,1999:blog-29286778.post-859445022467769296' source='http://www.blogger.com/feeds/29286778/posts/default/859445022467769296' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1465192871'/></entry><entry><id>tag:blogger.com,1999:blog-29286778.post-8493237871590069378</id><published>2011-09-13T17:52:35.973-04:00</published><updated>2011-09-13T17:52:35.973-04:00</updated><title type='text'>great information, my sp improved from 79s to 1.5s...</title><content type='html'>great information, my sp improved from 79s to 1.5s, you saved me tons of time and painful diagnosing.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/8493237871590069378'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/8493237871590069378'/><link rel='alternate' type='text/html' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html?showComment=1315950755973#c8493237871590069378' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html' ref='tag:blogger.com,1999:blog-29286778.post-859445022467769296' source='http://www.blogger.com/feeds/29286778/posts/default/859445022467769296' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1748561636'/></entry><entry><id>tag:blogger.com,1999:blog-29286778.post-2910568652416968161</id><published>2011-08-31T20:15:20.977-04:00</published><updated>2011-08-31T20:15:20.977-04:00</updated><title type='text'>Just to answer some questions about differences in...</title><content type='html'>Just to answer some questions about differences in performance from different clients, each connection that is determined to be different (even a slightly different connection string from the same application) keeps its own execution plans.  This is why the same stored procedure may run fast in query analyzer while being slow in an application.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/2910568652416968161'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/2910568652416968161'/><link rel='alternate' type='text/html' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html?showComment=1314836120977#c2910568652416968161' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html' ref='tag:blogger.com,1999:blog-29286778.post-859445022467769296' source='http://www.blogger.com/feeds/29286778/posts/default/859445022467769296' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1542498420'/></entry><entry><id>tag:blogger.com,1999:blog-29286778.post-717407300103680513</id><published>2011-07-21T23:47:17.858-04:00</published><updated>2011-07-21T23:47:17.858-04:00</updated><title type='text'>good article.  my sproc went from 34 seconds down ...</title><content type='html'>good article.  my sproc went from 34 seconds down to 1.5. thanks, james</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/717407300103680513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/717407300103680513'/><link rel='alternate' type='text/html' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html?showComment=1311306437858#c717407300103680513' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html' ref='tag:blogger.com,1999:blog-29286778.post-859445022467769296' source='http://www.blogger.com/feeds/29286778/posts/default/859445022467769296' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1834357091'/></entry><entry><id>tag:blogger.com,1999:blog-29286778.post-2128883999502427474</id><published>2011-05-17T14:26:16.256-04:00</published><updated>2011-05-17T14:26:16.256-04:00</updated><title type='text'>Very good article. Nicely explained.</title><content type='html'>Very good article. Nicely explained.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/2128883999502427474'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/2128883999502427474'/><link rel='alternate' type='text/html' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html?showComment=1305656776256#c2128883999502427474' title=''/><author><name>Syed Shah Lateef Ahmed</name><uri>http://www.saudiremittance.com</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html' ref='tag:blogger.com,1999:blog-29286778.post-859445022467769296' source='http://www.blogger.com/feeds/29286778/posts/default/859445022467769296' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-668956917'/></entry><entry><id>tag:blogger.com,1999:blog-29286778.post-2455847768507661544</id><published>2011-05-05T19:43:36.731-04:00</published><updated>2011-05-05T19:43:36.731-04:00</updated><title type='text'>Ok I have seen loads of posts of using option (rec...</title><content type='html'>Ok I have seen loads of posts of using option (recompile) and using local variables in a stored procedure.  What about if you are not in control of the generation of the query, as when using Dynamics CRM.  It&amp;#39;s queries are passed into the sp_executesql stored proc with a literal string of the query &amp;amp; parameters.  This gives the same parameters sniffing problem.  If i capture the SQL query being produced using profiler &amp;amp; then re-run in management studio, i see the use of a old plan &amp;amp; the query taking minutes.  If i amend the query string and add a option (recompile) or actually just adding a space in the string - the query plan is re-evaluated and the results are returned within a second.  Trouble is the CRM platform is generating the query so I cant intercept.  Is there a way to fix this at a server level???</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/2455847768507661544'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/2455847768507661544'/><link rel='alternate' type='text/html' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html?showComment=1304639016731#c2455847768507661544' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html' ref='tag:blogger.com,1999:blog-29286778.post-859445022467769296' source='http://www.blogger.com/feeds/29286778/posts/default/859445022467769296' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1618386945'/></entry><entry><id>tag:blogger.com,1999:blog-29286778.post-2425380796221544335</id><published>2011-02-17T06:26:24.400-05:00</published><updated>2011-02-17T06:26:24.400-05:00</updated><title type='text'>Great article
I have a similar problem where a sim...</title><content type='html'>Great article&lt;br /&gt;I have a similar problem where a simple stored procedure times out (takes more than 30 seconds when executed from a Delphi client), but running the procedure from management studio takes 1 second.&lt;br /&gt;As soon as I alter the procedure, it starts working fast again.&lt;br /&gt;My question is, why the procedure (with the same parameters) runs fast in management studio? If it was parameter sniffing, wouldnt be affecting every client?&lt;br /&gt;&lt;br /&gt;thanks again for the great article.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/2425380796221544335'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/2425380796221544335'/><link rel='alternate' type='text/html' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html?showComment=1297941984400#c2425380796221544335' title=''/><author><name>Y. Bamarni</name><uri>http://www.blogger.com/profile/11596136301556554251</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html' ref='tag:blogger.com,1999:blog-29286778.post-859445022467769296' source='http://www.blogger.com/feeds/29286778/posts/default/859445022467769296' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1429867608'/></entry><entry><id>tag:blogger.com,1999:blog-29286778.post-7394309660341210050</id><published>2011-01-31T12:36:28.391-05:00</published><updated>2011-01-31T12:36:28.391-05:00</updated><title type='text'>Many thanks for the clear explanation</title><content type='html'>Many thanks for the clear explanation</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/7394309660341210050'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/7394309660341210050'/><link rel='alternate' type='text/html' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html?showComment=1296495388391#c7394309660341210050' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html' ref='tag:blogger.com,1999:blog-29286778.post-859445022467769296' source='http://www.blogger.com/feeds/29286778/posts/default/859445022467769296' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1715612469'/></entry><entry><id>tag:blogger.com,1999:blog-29286778.post-8061507920693593493</id><published>2011-01-31T07:22:34.885-05:00</published><updated>2011-01-31T07:22:34.885-05:00</updated><title type='text'>Hmm - is it something I didn&amp;#39;t properly get in...</title><content type='html'>Hmm - is it something I didn&amp;#39;t properly get in this ? - I seem to have same cause of problem, but cannot fix it by declaring variables and using them inside my stored procedure.&lt;br /&gt;&lt;br /&gt;My SP has approx 10 joined views (select.... ) as xxx inner join ....)&lt;br /&gt;It runs in 5 seconds from sql server management studio, it takes 5 minutes or so when I run the same thing from Reporting services. &lt;br /&gt;&lt;br /&gt;I even tried with Optimise for... and recompile. &lt;br /&gt;Any other reason it could be that the same procedure takes forever when running thru reporting services ?&lt;br /&gt;Jostein</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/8061507920693593493'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/8061507920693593493'/><link rel='alternate' type='text/html' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html?showComment=1296476554885#c8061507920693593493' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html' ref='tag:blogger.com,1999:blog-29286778.post-859445022467769296' source='http://www.blogger.com/feeds/29286778/posts/default/859445022467769296' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-511367139'/></entry><entry><id>tag:blogger.com,1999:blog-29286778.post-393618385415554571</id><published>2011-01-31T06:19:17.131-05:00</published><updated>2011-01-31T06:19:17.131-05:00</updated><title type='text'>Hmm.
This seems to give a lot of meaning, but is i...</title><content type='html'>Hmm.&lt;br /&gt;This seems to give a lot of meaning, but is it something I didnt get here.&lt;br /&gt;I have this SP that runs 15 seconds in SQLserver management studio, and when I run the same thru Reporting services it takes approx 5 minutes.&lt;br /&gt;I&amp;#39;ve change the sp, so that it uses locally defined variables in the where statements.&lt;br /&gt;&lt;br /&gt;Jostein&lt;br /&gt;Is it still a reason why Reporting services should take 100 times longer than the actual run of the SP ? (And yes: I did try with defining the sp with recompile, seems to make no difference.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/393618385415554571'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/393618385415554571'/><link rel='alternate' type='text/html' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html?showComment=1296472757131#c393618385415554571' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html' ref='tag:blogger.com,1999:blog-29286778.post-859445022467769296' source='http://www.blogger.com/feeds/29286778/posts/default/859445022467769296' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-511367139'/></entry><entry><id>tag:blogger.com,1999:blog-29286778.post-8369483474501234540</id><published>2010-09-09T21:55:07.302-04:00</published><updated>2010-09-09T21:55:07.302-04:00</updated><title type='text'>nice One !</title><content type='html'>nice One !</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/8369483474501234540'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/8369483474501234540'/><link rel='alternate' type='text/html' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html?showComment=1284083707302#c8369483474501234540' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html' ref='tag:blogger.com,1999:blog-29286778.post-859445022467769296' source='http://www.blogger.com/feeds/29286778/posts/default/859445022467769296' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1243071522'/></entry><entry><id>tag:blogger.com,1999:blog-29286778.post-5241607798203242606</id><published>2010-09-07T03:18:46.431-04:00</published><updated>2010-09-07T03:18:46.431-04:00</updated><title type='text'>Thanx dude. Our team sat for hours trying to figur...</title><content type='html'>Thanx dude. Our team sat for hours trying to figure out why a SP takes 5min to run while the inner script took 8sec on it&amp;#39;s own.&lt;br /&gt;Applied the local vars solution and bam, 8sec.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/5241607798203242606'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/5241607798203242606'/><link rel='alternate' type='text/html' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html?showComment=1283843926431#c5241607798203242606' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html' ref='tag:blogger.com,1999:blog-29286778.post-859445022467769296' source='http://www.blogger.com/feeds/29286778/posts/default/859445022467769296' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-710829003'/></entry><entry><id>tag:blogger.com,1999:blog-29286778.post-4892776162517102803</id><published>2010-08-02T08:12:23.056-04:00</published><updated>2010-08-02T08:12:23.056-04:00</updated><title type='text'>Great explanation! Thanks! That really helped me w...</title><content type='html'>Great explanation! Thanks! That really helped me with a recent problem I had</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/4892776162517102803'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/4892776162517102803'/><link rel='alternate' type='text/html' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html?showComment=1280751143056#c4892776162517102803' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html' ref='tag:blogger.com,1999:blog-29286778.post-859445022467769296' source='http://www.blogger.com/feeds/29286778/posts/default/859445022467769296' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-292471381'/></entry><entry><id>tag:blogger.com,1999:blog-29286778.post-8486771871339826546</id><published>2010-07-07T11:46:02.261-04:00</published><updated>2010-07-07T11:46:02.261-04:00</updated><title type='text'>Fantastic explanation.  Its a shame I spent 4 hour...</title><content type='html'>Fantastic explanation.  Its a shame I spent 4 hours tearing my hair out before I found this article.  ;)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/8486771871339826546'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/8486771871339826546'/><link rel='alternate' type='text/html' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html?showComment=1278517562261#c8486771871339826546' title=''/><author><name>Rob G</name><uri>http://openid.aol.com/progerman</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/openid16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html' ref='tag:blogger.com,1999:blog-29286778.post-859445022467769296' source='http://www.blogger.com/feeds/29286778/posts/default/859445022467769296' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-844837009'/></entry><entry><id>tag:blogger.com,1999:blog-29286778.post-7184773293697540122</id><published>2010-06-15T12:49:21.801-04:00</published><updated>2010-06-15T12:49:21.801-04:00</updated><title type='text'>Thanks for the very clear explanation - it helped ...</title><content type='html'>Thanks for the very clear explanation - it helped me get the execution time down from 20 minutes to 12 seconds!</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/7184773293697540122'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/7184773293697540122'/><link rel='alternate' type='text/html' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html?showComment=1276620561801#c7184773293697540122' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html' ref='tag:blogger.com,1999:blog-29286778.post-859445022467769296' source='http://www.blogger.com/feeds/29286778/posts/default/859445022467769296' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-2000310991'/></entry><entry><id>tag:blogger.com,1999:blog-29286778.post-1813240447944592692</id><published>2010-06-07T08:18:44.525-04:00</published><updated>2010-06-07T08:18:44.525-04:00</updated><title type='text'>SQL Server 2008 SP1 Cumulative Update 7 and SQL Se...</title><content type='html'>SQL Server 2008 SP1 Cumulative Update 7 and SQL Server 2005 SP3 Cumulative Update 9 introduce trace flag 4136 that can be used to disable the &amp;quot;parameter sniffing&amp;quot; process, see http://support.microsoft.com/kb/980653/</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/1813240447944592692'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/1813240447944592692'/><link rel='alternate' type='text/html' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html?showComment=1275913124525#c1813240447944592692' title=''/><author><name>Wilfred van Dijk</name><uri>http://www.wilfredvandijk.nl</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html' ref='tag:blogger.com,1999:blog-29286778.post-859445022467769296' source='http://www.blogger.com/feeds/29286778/posts/default/859445022467769296' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1388369409'/></entry><entry><id>tag:blogger.com,1999:blog-29286778.post-2457686191987841467</id><published>2010-05-11T08:20:06.794-04:00</published><updated>2010-05-11T08:20:06.794-04:00</updated><title type='text'>Great Job and thanks very much!  I notice this pro...</title><content type='html'>Great Job and thanks very much!  I notice this problem some months ago but it&amp;#39;s your wonderful solution which help me solving this problem completely!  (I was using WITH RECOMPILE procedure hint to solve this problem but it did not work well on large SQL procedures...)&lt;br /&gt;Really great and wonderful!</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/2457686191987841467'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/2457686191987841467'/><link rel='alternate' type='text/html' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html?showComment=1273580406794#c2457686191987841467' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html' ref='tag:blogger.com,1999:blog-29286778.post-859445022467769296' source='http://www.blogger.com/feeds/29286778/posts/default/859445022467769296' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-78408002'/></entry><entry><id>tag:blogger.com,1999:blog-29286778.post-4522591565186804836</id><published>2010-03-17T09:40:23.790-04:00</published><updated>2010-03-17T09:40:23.790-04:00</updated><title type='text'>Thanks alot dude... keep up the work!!</title><content type='html'>Thanks alot dude... keep up the work!!</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/4522591565186804836'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/4522591565186804836'/><link rel='alternate' type='text/html' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html?showComment=1268833223790#c4522591565186804836' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html' ref='tag:blogger.com,1999:blog-29286778.post-859445022467769296' source='http://www.blogger.com/feeds/29286778/posts/default/859445022467769296' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1854348323'/></entry><entry><id>tag:blogger.com,1999:blog-29286778.post-8136988059292693113</id><published>2010-03-09T06:31:12.278-05:00</published><updated>2010-03-09T06:31:12.278-05:00</updated><title type='text'>Great Article.
Thanks</title><content type='html'>Great Article.&lt;br /&gt;Thanks</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/8136988059292693113'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/8136988059292693113'/><link rel='alternate' type='text/html' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html?showComment=1268134272278#c8136988059292693113' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html' ref='tag:blogger.com,1999:blog-29286778.post-859445022467769296' source='http://www.blogger.com/feeds/29286778/posts/default/859445022467769296' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-214807488'/></entry><entry><id>tag:blogger.com,1999:blog-29286778.post-157123070319832044</id><published>2010-03-08T16:51:48.252-05:00</published><updated>2010-03-08T16:51:48.252-05:00</updated><title type='text'>Thanks for this article.  It&amp;#39;s a really intere...</title><content type='html'>Thanks for this article.  It&amp;#39;s a really interesting read and saved the day when one of my procs slowed down!</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/157123070319832044'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/157123070319832044'/><link rel='alternate' type='text/html' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html?showComment=1268085108252#c157123070319832044' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html' ref='tag:blogger.com,1999:blog-29286778.post-859445022467769296' source='http://www.blogger.com/feeds/29286778/posts/default/859445022467769296' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1227678146'/></entry><entry><id>tag:blogger.com,1999:blog-29286778.post-7557053169519870034</id><published>2010-02-20T18:27:56.658-05:00</published><updated>2010-02-20T18:27:56.658-05:00</updated><title type='text'>I have been asked Question during Microsoft interv...</title><content type='html'>I have been asked Question during Microsoft interview like this &amp;quot;Stored Proc runs perfactly fine and few days later same Proc takes 15-20 Minutes to execute.What will be the potential problem here?&lt;br /&gt;&lt;br /&gt;Thank you in advance</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/7557053169519870034'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/7557053169519870034'/><link rel='alternate' type='text/html' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html?showComment=1266708476658#c7557053169519870034' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html' ref='tag:blogger.com,1999:blog-29286778.post-859445022467769296' source='http://www.blogger.com/feeds/29286778/posts/default/859445022467769296' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1669399980'/></entry><entry><id>tag:blogger.com,1999:blog-29286778.post-8069630905097508815</id><published>2010-02-10T18:19:19.220-05:00</published><updated>2010-02-10T18:19:19.220-05:00</updated><title type='text'>Thanks a lot, it solved mysterious too long execut...</title><content type='html'>Thanks a lot, it solved mysterious too long execution of sp</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/8069630905097508815'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/8069630905097508815'/><link rel='alternate' type='text/html' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html?showComment=1265843959220#c8069630905097508815' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html' ref='tag:blogger.com,1999:blog-29286778.post-859445022467769296' source='http://www.blogger.com/feeds/29286778/posts/default/859445022467769296' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1229343601'/></entry><entry><id>tag:blogger.com,1999:blog-29286778.post-6476209568414006344</id><published>2009-12-18T08:15:14.615-05:00</published><updated>2009-12-18T08:15:14.615-05:00</updated><title type='text'>Great post.  Covers complete detail.</title><content type='html'>Great post.  Covers complete detail.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/6476209568414006344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/6476209568414006344'/><link rel='alternate' type='text/html' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html?showComment=1261142114615#c6476209568414006344' title=''/><author><name>Guru</name><uri>http://www.blogger.com/profile/13413239924030117606</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_MrIaF19NP8s/Sa6sZTSBN5I/AAAAAAAABs8/OPpd9xn6R4E/S220/P1130519.JPG'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html' ref='tag:blogger.com,1999:blog-29286778.post-859445022467769296' source='http://www.blogger.com/feeds/29286778/posts/default/859445022467769296' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1145909035'/></entry><entry><id>tag:blogger.com,1999:blog-29286778.post-2629916490491874208</id><published>2009-12-16T14:41:31.237-05:00</published><updated>2009-12-16T14:41:31.237-05:00</updated><title type='text'>Thank you so much. Truly un-expected behavior.</title><content type='html'>Thank you so much. Truly un-expected behavior.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/2629916490491874208'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/2629916490491874208'/><link rel='alternate' type='text/html' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html?showComment=1260992491237#c2629916490491874208' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html' ref='tag:blogger.com,1999:blog-29286778.post-859445022467769296' source='http://www.blogger.com/feeds/29286778/posts/default/859445022467769296' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-863410340'/></entry><entry><id>tag:blogger.com,1999:blog-29286778.post-7603415065739749206</id><published>2009-10-05T05:20:24.896-04:00</published><updated>2009-10-05T05:20:24.896-04:00</updated><title type='text'>Brilliant article. Thanks. And it&amp;#39;s quite well...</title><content type='html'>Brilliant article. Thanks. And it&amp;#39;s quite well written so that the problem and the solution is clearly understandable.&lt;br /&gt;&lt;br /&gt;It is very rare that I learn that have a widespread effect on how I write SQL code, but I just did today.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/7603415065739749206'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29286778/859445022467769296/comments/default/7603415065739749206'/><link rel='alternate' type='text/html' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html?showComment=1254734424896#c7603415065739749206' title=''/><author><name>Pete</name><uri>http://www.blogger.com/profile/00837792514482633418</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html' ref='tag:blogger.com,1999:blog-29286778.post-859445022467769296' source='http://www.blogger.com/feeds/29286778/posts/default/859445022467769296' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-958554312'/></entry></feed>
