<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: SQL Server Parameter Sniffing	</title>
	<atom:link href="https://www.dbrnd.com/2015/05/sql-server-parameter-sniffing/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com/2015/05/sql-server-parameter-sniffing/</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Thu, 15 Feb 2018 15:48:48 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.4</generator>
	<item>
		<title>
		By: Chris		</title>
		<link>https://www.dbrnd.com/2015/05/sql-server-parameter-sniffing/#comment-6230</link>

		<dc:creator><![CDATA[Chris]]></dc:creator>
		<pubDate>Thu, 15 Feb 2018 15:48:48 +0000</pubDate>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=215#comment-6230</guid>

					<description><![CDATA[I recently had a stored procedure where &#039;with recompile&#039; and &#039;Optimize For&#039; did not work but using local (dummy) parameters did.  Sort of SQL Server 2005 methodology that worked best in my situation on a SQL Server 2016 instance.

Example:

CREATE PROCEDURE dbo.usp_EmployeeData
(
     @EmpID INT
)
AS

DECLARE @localEmpID INT = @EmpID;

SELECT EmployeName, EmployeeDOB, EmployeeClass
FROM dbo.tbl_EmployeeDetails
WHERE EmpID = @localEmpID

GO]]></description>
			<content:encoded><![CDATA[<p>I recently had a stored procedure where &#8216;with recompile&#8217; and &#8216;Optimize For&#8217; did not work but using local (dummy) parameters did.  Sort of SQL Server 2005 methodology that worked best in my situation on a SQL Server 2016 instance.</p>
<p>Example:</p>
<p>CREATE PROCEDURE dbo.usp_EmployeeData<br />
(<br />
     @EmpID INT<br />
)<br />
AS</p>
<p>DECLARE @localEmpID INT = @EmpID;</p>
<p>SELECT EmployeName, EmployeeDOB, EmployeeClass<br />
FROM dbo.tbl_EmployeeDetails<br />
WHERE EmpID = @localEmpID</p>
<p>GO</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Anvesh Patel		</title>
		<link>https://www.dbrnd.com/2015/05/sql-server-parameter-sniffing/#comment-4440</link>

		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Fri, 08 Apr 2016 14:15:35 +0000</pubDate>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=215#comment-4440</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.dbrnd.com/2015/05/sql-server-parameter-sniffing/#comment-4439&quot;&gt;amit bansal&lt;/a&gt;.

Thanks Amit, for your input.]]></description>
			<content:encoded><![CDATA[<p>Thanks Amit, for your input.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: amit bansal		</title>
		<link>https://www.dbrnd.com/2015/05/sql-server-parameter-sniffing/#comment-4439</link>

		<dc:creator><![CDATA[amit bansal]]></dc:creator>
		<pubDate>Fri, 08 Apr 2016 10:29:49 +0000</pubDate>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=215#comment-4439</guid>

					<description><![CDATA[Just happen to come across the post and gave a quick read. You are missing an important point that the optimizer sniffs the parameter value nd creates a plan optimized for that value, which gets reused subsequently. Good effort though...]]></description>
			<content:encoded><![CDATA[<p>Just happen to come across the post and gave a quick read. You are missing an important point that the optimizer sniffs the parameter value nd creates a plan optimized for that value, which gets reused subsequently. Good effort though&#8230;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Anvesh Patel		</title>
		<link>https://www.dbrnd.com/2015/05/sql-server-parameter-sniffing/#comment-2092</link>

		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Thu, 04 Feb 2016 04:27:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=215#comment-2092</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.dbrnd.com/2015/05/sql-server-parameter-sniffing/#comment-2091&quot;&gt;Yogesh Shind&lt;/a&gt;.

Oky thanks Yogesh, I will check.]]></description>
			<content:encoded><![CDATA[<p>Oky thanks Yogesh, I will check.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yogesh Shind		</title>
		<link>https://www.dbrnd.com/2015/05/sql-server-parameter-sniffing/#comment-2091</link>

		<dc:creator><![CDATA[Yogesh Shind]]></dc:creator>
		<pubDate>Thu, 04 Feb 2016 04:24:32 +0000</pubDate>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=215#comment-2091</guid>

					<description><![CDATA[I think there is one more way to avoid it. You can declare variable inside and assign the variable of SP to these variables]]></description>
			<content:encoded><![CDATA[<p>I think there is one more way to avoid it. You can declare variable inside and assign the variable of SP to these variables</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
