<?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/"
	xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments for SQL Tips by Namwar Rizvi</title>
	<atom:link href="http://sqltips.wordpress.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://sqltips.wordpress.com</link>
	<description>SQL Tips and Tricks by Namwar Rizvi</description>
	<lastBuildDate>Fri, 09 Oct 2009 19:10:05 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on Calculating last day of the month by TSQL by Tim</title>
		<link>http://sqltips.wordpress.com/2007/05/16/calculating-last-day-of-the-month-by-tsql/#comment-254</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Fri, 09 Oct 2009 19:10:05 +0000</pubDate>
		<guid isPermaLink="false">http://sqltips.wordpress.com/2007/05/16/calculating-last-day-of-the-month-by-tsql/#comment-254</guid>
		<description>Thank you. I uses a similar query before, but I knew that Google would be faster than looking through my notes. ps. You were on top of my Google search &quot;sql calculate last day of the month.&quot;

I needed to find the last day of the month for the StartDate a year from now, but that part was easy, just add a year to the Start Date variable before you start your calculation:

SELECT DateAdd(day, -1, DateAdd( month, DateDiff(month , 0, dateadd(yy, 1, @m_StartDate))+1 , 0))</description>
		<content:encoded><![CDATA[<p>Thank you. I uses a similar query before, but I knew that Google would be faster than looking through my notes. ps. You were on top of my Google search &#8220;sql calculate last day of the month.&#8221;</p>
<p>I needed to find the last day of the month for the StartDate a year from now, but that part was easy, just add a year to the Start Date variable before you start your calculation:</p>
<p>SELECT DateAdd(day, -1, DateAdd( month, DateDiff(month , 0, dateadd(yy, 1, @m_StartDate))+1 , 0))</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Number padding in TSQL by Travis Riffle</title>
		<link>http://sqltips.wordpress.com/2007/08/24/number-padding-in-tsql/#comment-253</link>
		<dc:creator>Travis Riffle</dc:creator>
		<pubDate>Mon, 05 Oct 2009 14:19:21 +0000</pubDate>
		<guid isPermaLink="false">http://sqltips.wordpress.com/2007/08/24/number-padding-in-tsql/#comment-253</guid>
		<description>This worked great, if you need leading zeros for say 10 characters, but your max is actually 6, you can always just manually set the max to 10!  I did that in my case and it worked great.

Declare @m_maxLength int
Select
@m_maxLength=8
from Unit


update Unit
set EndUserNumber = Replicate(&#039;0&#039;,@m_maxLength-Len(convert(varchar,EndUserNumber)))
+convert(varchar,EndUserNumber)</description>
		<content:encoded><![CDATA[<p>This worked great, if you need leading zeros for say 10 characters, but your max is actually 6, you can always just manually set the max to 10!  I did that in my case and it worked great.</p>
<p>Declare @m_maxLength int<br />
Select<br />
@m_maxLength=8<br />
from Unit</p>
<p>update Unit<br />
set EndUserNumber = Replicate(&#8216;0&#8242;,@m_maxLength-Len(convert(varchar,EndUserNumber)))<br />
+convert(varchar,EndUserNumber)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Changing the Object Schema in SQL Server 2005 by gelay</title>
		<link>http://sqltips.wordpress.com/2007/06/24/changing-the-object-schema-in-sql-server-2005/#comment-252</link>
		<dc:creator>gelay</dc:creator>
		<pubDate>Thu, 01 Oct 2009 10:17:35 +0000</pubDate>
		<guid isPermaLink="false">http://sqltips.wordpress.com/2007/06/24/changing-the-object-schema-in-sql-server-2005/#comment-252</guid>
		<description>Alhamdulillah

thanks for the tips. very helpful.</description>
		<content:encoded><![CDATA[<p>Alhamdulillah</p>
<p>thanks for the tips. very helpful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on SQL Server Client Tools Setup Fails due to MSXML 6 by How to Install SQL Server 2005 Client Tools? &#171; SQL Tips by Namwar Rizvi</title>
		<link>http://sqltips.wordpress.com/2009/04/13/sql-server-client-tools-setup-fails-due-to-msxml-6/#comment-247</link>
		<dc:creator>How to Install SQL Server 2005 Client Tools? &#171; SQL Tips by Namwar Rizvi</dc:creator>
		<pubDate>Mon, 31 Aug 2009 22:21:50 +0000</pubDate>
		<guid isPermaLink="false">http://sqltips.wordpress.com/?p=147#comment-247</guid>
		<description>[...] &#8212; namwar @ 10:21 pm Tags: How To, Setup, SQL Server 2005, tips  Further to my earlier post  SQL Server Client Tools Setup Fails due to MSXML 6 , in which I mentioned a solution for SQL Server Client Tools setup failure, if you are still [...]</description>
		<content:encoded><![CDATA[<p>[...] &#8212; namwar @ 10:21 pm Tags: How To, Setup, SQL Server 2005, tips  Further to my earlier post  SQL Server Client Tools Setup Fails due to MSXML 6 , in which I mentioned a solution for SQL Server Client Tools setup failure, if you are still [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Calculate Difference between current and previous rows&#8230;..CTE and Row_Number() rocks! by fabio</title>
		<link>http://sqltips.wordpress.com/2007/05/21/calculate-difference-between-current-and-previous-rowscte-and-row_number-rocks/#comment-245</link>
		<dc:creator>fabio</dc:creator>
		<pubDate>Thu, 27 Aug 2009 14:00:54 +0000</pubDate>
		<guid isPermaLink="false">http://sqltips.wordpress.com/2007/05/21/calculate-difference-between-current-and-previous-rowscte-and-row_number-rocks/#comment-245</guid>
		<description>Hi , Ramesh 
dou remember this query? have you resolved the problem? 

Query: Calulate the temperature difference on Temperature column

Output should be:

DayId DayName Temperature DifferenceTemperature
——– ———— ——————- ——————
SN Sunday 32 6
MN Monday 39 -3
TU Tuesday 36 9
WD Wednesday 45 -4
TH Thursday 41 6
FR Friday 47 -7
SA Satruday 40 null

Please explain the query

Comment by Ramesh — May 23, 2008 @ 11:12 am &#124; Reply</description>
		<content:encoded><![CDATA[<p>Hi , Ramesh<br />
dou remember this query? have you resolved the problem? </p>
<p>Query: Calulate the temperature difference on Temperature column</p>
<p>Output should be:</p>
<p>DayId DayName Temperature DifferenceTemperature<br />
——– ———— ——————- ——————<br />
SN Sunday 32 6<br />
MN Monday 39 -3<br />
TU Tuesday 36 9<br />
WD Wednesday 45 -4<br />
TH Thursday 41 6<br />
FR Friday 47 -7<br />
SA Satruday 40 null</p>
<p>Please explain the query</p>
<p>Comment by Ramesh — May 23, 2008 @ 11:12 am | Reply</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on TSQL Function to encode HTML Text by Sunil</title>
		<link>http://sqltips.wordpress.com/2009/01/20/tsql-function-to-encode-html-text/#comment-244</link>
		<dc:creator>Sunil</dc:creator>
		<pubDate>Wed, 26 Aug 2009 00:40:59 +0000</pubDate>
		<guid isPermaLink="false">http://sqltips.wordpress.com/?p=135#comment-244</guid>
		<description>Good post! Just what I was looking for.</description>
		<content:encoded><![CDATA[<p>Good post! Just what I was looking for.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on TSQL Function to convert decimal to Hex, Octal or any other base by Lars</title>
		<link>http://sqltips.wordpress.com/2009/01/12/tsql-function-to-convert-decimal-to-hex-octal-or-any-other-base/#comment-242</link>
		<dc:creator>Lars</dc:creator>
		<pubDate>Thu, 06 Aug 2009 18:47:25 +0000</pubDate>
		<guid isPermaLink="false">http://sqltips.wordpress.com/?p=131#comment-242</guid>
		<description>Great! 

Do you happen to have a decode function? i.e. fn_BaseToDec?</description>
		<content:encoded><![CDATA[<p>Great! </p>
<p>Do you happen to have a decode function? i.e. fn_BaseToDec?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Insert Script Generator by Bob</title>
		<link>http://sqltips.wordpress.com/2007/05/22/insert-script-generator/#comment-241</link>
		<dc:creator>Bob</dc:creator>
		<pubDate>Wed, 24 Jun 2009 13:12:46 +0000</pubDate>
		<guid isPermaLink="false">http://sqltips.wordpress.com/2007/05/22/insert-script-generator/#comment-241</guid>
		<description>This script doesn&#039;t work;

1.) all the quotes display wrongly in the HTML on this page, meaning copy &amp; paste is a no no.
2.) If you try and find/replace the quotes out and replace with the correct single &amp; double quotes, it still throws errors when running in an attempt to create the stored proc against a SQL Server data source.

Offer the (working) script as a downloadable archive (zip/rar) with a readme perhaps? It will enable people to at least use the script, which does offer quite a useful piece of functionality!

-Bob (Pseud)</description>
		<content:encoded><![CDATA[<p>This script doesn&#8217;t work;</p>
<p>1.) all the quotes display wrongly in the HTML on this page, meaning copy &amp; paste is a no no.<br />
2.) If you try and find/replace the quotes out and replace with the correct single &amp; double quotes, it still throws errors when running in an attempt to create the stored proc against a SQL Server data source.</p>
<p>Offer the (working) script as a downloadable archive (zip/rar) with a readme perhaps? It will enable people to at least use the script, which does offer quite a useful piece of functionality!</p>
<p>-Bob (Pseud)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Optimized solution of Paging by using Count(*) OVER() functionality by Yash</title>
		<link>http://sqltips.wordpress.com/2007/08/10/optimized-solution-of-paging-by-using-count-over-functionality/#comment-240</link>
		<dc:creator>Yash</dc:creator>
		<pubDate>Fri, 19 Jun 2009 16:29:41 +0000</pubDate>
		<guid isPermaLink="false">http://sqltips.wordpress.com/2007/08/10/optimized-solution-of-paging-by-using-count-over-functionality/#comment-240</guid>
		<description>ROW_NUMBER() OVER(ORDER BY [RandomField] DESC) is anyways going to give you the total number of records then why would you do for Count(*) OVER()?</description>
		<content:encoded><![CDATA[<p>ROW_NUMBER() OVER(ORDER BY [RandomField] DESC) is anyways going to give you the total number of records then why would you do for Count(*) OVER()?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Generate rows for missing dates by Andy Bauch</title>
		<link>http://sqltips.wordpress.com/2008/11/10/generate-rows-for-missing-dates/#comment-239</link>
		<dc:creator>Andy Bauch</dc:creator>
		<pubDate>Thu, 18 Jun 2009 01:21:47 +0000</pubDate>
		<guid isPermaLink="false">http://sqltips.wordpress.com/?p=117#comment-239</guid>
		<description>This example was extremely helpful.  Thanks!</description>
		<content:encoded><![CDATA[<p>This example was extremely helpful.  Thanks!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
