<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlblogcasts.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Madhivanan - All Comments</title><link>http://sqlblogcasts.com/blogs/madhivanan/default.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007.1 (Build: 20917.1142)</generator><item><title>re: When was my Server restarted?</title><link>http://sqlblogcasts.com/blogs/madhivanan/archive/2008/06/09/when-was-my-server-restarted.aspx#11825</link><pubDate>Mon, 08 Jun 2009 12:48:40 GMT</pubDate><guid isPermaLink="false">fa8c4e8e-46a3-4193-8264-2c1a9cb3475d:11825</guid><dc:creator>vmvadivel</dc:creator><description>&lt;p&gt;Though checking the creation date of TEMPDB will do the trick. Its not a guaranteed method. &lt;/p&gt;
&lt;p&gt;Bcoz PSS when they do troubleshooting some tempdb issues could have used T3609 to recover tempdb instead of recreating it. &lt;/p&gt;
&lt;p&gt;So the best method and the only method to trust 100% is to check the time in sysprocesses as I have shown in my blog post.&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://vadivel.blogspot.com/2009/05/how-to-find-when-sql-server-was-last.html"&gt;vadivel.blogspot.com/.../how-to-find-when-sql-server-was-last.html&lt;/a&gt;&lt;/p&gt;
&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=11825" width="1" height="1"&gt;</description></item><item><title>Server Side Guy  &amp;raquo; Escaping Single Quotes in MS SQL Server (T-SQL)</title><link>http://sqlblogcasts.com/blogs/madhivanan/archive/2008/02/19/understanding-single-quotes.aspx#11798</link><pubDate>Tue, 02 Jun 2009 15:34:27 GMT</pubDate><guid isPermaLink="false">fa8c4e8e-46a3-4193-8264-2c1a9cb3475d:11798</guid><dc:creator>Server Side Guy  » Escaping Single Quotes in MS SQL Server (T-SQL)</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;Server Side Guy &amp;nbsp;&amp;amp;raquo; Escaping Single Quotes in MS SQL Server (T-SQL)&lt;/p&gt;
&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=11798" width="1" height="1"&gt;</description></item><item><title>Fishy feature? | keyongtech</title><link>http://sqlblogcasts.com/blogs/madhivanan/archive/2008/09/09/should-alias-names-be-preceded-by-as-part-2.aspx#11771</link><pubDate>Thu, 28 May 2009 12:08:30 GMT</pubDate><guid isPermaLink="false">fa8c4e8e-46a3-4193-8264-2c1a9cb3475d:11771</guid><dc:creator>Fishy feature? | keyongtech</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;Fishy feature? | keyongtech&lt;/p&gt;
&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=11771" width="1" height="1"&gt;</description></item><item><title>Multiple Rows into One Row w/ Multiple Columns - dBforums</title><link>http://sqlblogcasts.com/blogs/madhivanan/archive/2007/08/27/dynamic-crosstab-with-multiple-pivot-columns.aspx#11679</link><pubDate>Sat, 16 May 2009 03:15:31 GMT</pubDate><guid isPermaLink="false">fa8c4e8e-46a3-4193-8264-2c1a9cb3475d:11679</guid><dc:creator>Multiple Rows into One Row w/ Multiple Columns - dBforums</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;Multiple Rows into One Row w/ Multiple Columns - dBforums&lt;/p&gt;
&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=11679" width="1" height="1"&gt;</description></item><item><title>final cumulative value | keyongtech</title><link>http://sqlblogcasts.com/blogs/madhivanan/archive/2008/09/12/return-top-n-rows.aspx#11665</link><pubDate>Thu, 14 May 2009 10:07:15 GMT</pubDate><guid isPermaLink="false">fa8c4e8e-46a3-4193-8264-2c1a9cb3475d:11665</guid><dc:creator>final cumulative value | keyongtech</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;final cumulative value | keyongtech&lt;/p&gt;
&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=11665" width="1" height="1"&gt;</description></item><item><title>re: Import from Text file - Single column to multiple columns</title><link>http://sqlblogcasts.com/blogs/madhivanan/archive/2009/05/05/import-from-text-file-single-column-to-multiple-columns.aspx#11605</link><pubDate>Wed, 06 May 2009 12:22:57 GMT</pubDate><guid isPermaLink="false">fa8c4e8e-46a3-4193-8264-2c1a9cb3475d:11605</guid><dc:creator>Madhivanan</dc:creator><description>&lt;p&gt;kongstad,&lt;/p&gt;
&lt;p&gt;It is ok for fixed number of columns. What if new column is added like State? You need to modify the query. Thats why I used dynamic sql which will take care of any number of columns&lt;/p&gt;
&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=11605" width="1" height="1"&gt;</description></item><item><title>re: Import from Text file - Single column to multiple columns</title><link>http://sqlblogcasts.com/blogs/madhivanan/archive/2009/05/05/import-from-text-file-single-column-to-multiple-columns.aspx#11604</link><pubDate>Wed, 06 May 2009 10:56:47 GMT</pubDate><guid isPermaLink="false">fa8c4e8e-46a3-4193-8264-2c1a9cb3475d:11604</guid><dc:creator>kongstad</dc:creator><description>&lt;p&gt;I think this select statement is a lot more intuitive than what you suggested.&lt;/p&gt;
&lt;p&gt;select &lt;/p&gt;
&lt;p&gt;	MAX(case when data=&amp;#39;AccountNo&amp;#39; then value else null end) AccountNo,&lt;/p&gt;
&lt;p&gt;	MAX(case when data=&amp;#39;AccountName&amp;#39; then value else null end) AccountName,&lt;/p&gt;
&lt;p&gt;	MAX(case when data=&amp;#39;City&amp;#39; then value else null end) City,&lt;/p&gt;
&lt;p&gt;	MAX(case when data=&amp;#39;Country&amp;#39; then value else null end) Country&lt;/p&gt;
&lt;p&gt;from &lt;/p&gt;
&lt;p&gt;(select (id-1)/4 id, data,value from test_data) a&lt;/p&gt;
&lt;p&gt;group by id&lt;/p&gt;
&lt;p&gt;It replaces all your code after you have added the identity column.&lt;/p&gt;
&lt;p&gt;It assumes that the data is ordered, and uses the id column to make a new value as (i-1)/4, assuring that connected rows have the same id.&lt;/p&gt;
&lt;p&gt;It then simply uses the max function to unpivot the table.&lt;/p&gt;
&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=11604" width="1" height="1"&gt;</description></item><item><title>re: Dynamic PIVOT in SQL Server 2005</title><link>http://sqlblogcasts.com/blogs/madhivanan/archive/2008/08/27/dynamic-pivot-in-sql-server-2005.aspx#11585</link><pubDate>Tue, 28 Apr 2009 14:34:09 GMT</pubDate><guid isPermaLink="false">fa8c4e8e-46a3-4193-8264-2c1a9cb3475d:11585</guid><dc:creator>Madhivanan</dc:creator><description>&lt;p&gt;gr leon,&lt;/p&gt;
&lt;p&gt;Refer method 2&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://sqlblogcasts.com/blogs/madhivanan/archive/2007/11/26/select-columns-from-exec-procedure-name-is-this-possible.aspx"&gt;sqlblogcasts.com/.../select-columns-from-exec-procedure-name-is-this-possible.aspx&lt;/a&gt;&lt;/p&gt;
&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=11585" width="1" height="1"&gt;</description></item><item><title>re: Dynamic PIVOT in SQL Server 2005</title><link>http://sqlblogcasts.com/blogs/madhivanan/archive/2008/08/27/dynamic-pivot-in-sql-server-2005.aspx#11582</link><pubDate>Tue, 28 Apr 2009 13:05:16 GMT</pubDate><guid isPermaLink="false">fa8c4e8e-46a3-4193-8264-2c1a9cb3475d:11582</guid><dc:creator>lcarpay</dc:creator><description>&lt;p&gt;Hi Madhivanan, do you have a clue how to INSERT INTO the result of this fantastic SP in a new table. I thought about making a function of your SP but as the columns are not know a design time I see no way to define such a udf.&lt;/p&gt;
&lt;p&gt;Can you help me out?&lt;/p&gt;
&lt;p&gt;gr leon&lt;/p&gt;
&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=11582" width="1" height="1"&gt;</description></item><item><title>Data types of result of stored procedure | keyongtech</title><link>http://sqlblogcasts.com/blogs/madhivanan/archive/2007/11/26/select-columns-from-exec-procedure-name-is-this-possible.aspx#11569</link><pubDate>Tue, 21 Apr 2009 14:07:47 GMT</pubDate><guid isPermaLink="false">fa8c4e8e-46a3-4193-8264-2c1a9cb3475d:11569</guid><dc:creator>Data types of result of stored procedure | keyongtech</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;Data types of result of stored procedure | keyongtech&lt;/p&gt;
&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=11569" width="1" height="1"&gt;</description></item><item><title>Filling random passwords - Set based approach</title><link>http://sqlblogcasts.com/blogs/madhivanan/archive/2007/11/20/random-password-generator.aspx#11499</link><pubDate>Mon, 30 Mar 2009 14:24:21 GMT</pubDate><guid isPermaLink="false">fa8c4e8e-46a3-4193-8264-2c1a9cb3475d:11499</guid><dc:creator>SQL Server Transact-SQL (SSQA.net)</dc:creator><description>&lt;p&gt;In this post , I showed a way to generate 8 characters random password If you have table with data and&lt;/p&gt;
&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=11499" width="1" height="1"&gt;</description></item><item><title>Filling random passwords - Set based approach</title><link>http://sqlblogcasts.com/blogs/madhivanan/archive/2007/11/20/random-password-generator.aspx#11492</link><pubDate>Fri, 27 Mar 2009 14:23:28 GMT</pubDate><guid isPermaLink="false">fa8c4e8e-46a3-4193-8264-2c1a9cb3475d:11492</guid><dc:creator>Madhivanan</dc:creator><description>&lt;p&gt;In this post , I showed a way to generate 8 character random password If you have table with data and&lt;/p&gt;
&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=11492" width="1" height="1"&gt;</description></item><item><title>re: Dynamic Crosstab with multiple PIVOT Columns</title><link>http://sqlblogcasts.com/blogs/madhivanan/archive/2007/08/27/dynamic-crosstab-with-multiple-pivot-columns.aspx#11462</link><pubDate>Thu, 19 Mar 2009 04:23:19 GMT</pubDate><guid isPermaLink="false">fa8c4e8e-46a3-4193-8264-2c1a9cb3475d:11462</guid><dc:creator>veera</dc:creator><description>&lt;p&gt;itemno wh1 wh2 wh3 tot &lt;/p&gt;
&lt;p&gt;----------------------&lt;/p&gt;
&lt;p&gt;F1 &amp;nbsp; &amp;nbsp; 10 &amp;nbsp;10 &amp;nbsp; 0 &amp;nbsp;20&lt;/p&gt;
&lt;p&gt;F2 &amp;nbsp; &amp;nbsp; 10 &amp;nbsp; 0 &amp;nbsp;10 &amp;nbsp;20&lt;/p&gt;
&lt;p&gt;F3 &amp;nbsp; &amp;nbsp; &amp;nbsp;0 &amp;nbsp; 0 &amp;nbsp;30 &amp;nbsp;30&lt;/p&gt;
&lt;p&gt;----------------------&lt;/p&gt;
&lt;p&gt;i need this type of format report. please give some idea to do this report&lt;/p&gt;
&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=11462" width="1" height="1"&gt;</description></item><item><title>columnar to row-based data - dBforums</title><link>http://sqlblogcasts.com/blogs/madhivanan/archive/2007/08/27/dynamic-crosstab-with-multiple-pivot-columns.aspx#11422</link><pubDate>Tue, 10 Mar 2009 09:23:29 GMT</pubDate><guid isPermaLink="false">fa8c4e8e-46a3-4193-8264-2c1a9cb3475d:11422</guid><dc:creator>columnar to row-based data - dBforums</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;columnar to row-based data - dBforums&lt;/p&gt;
&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=11422" width="1" height="1"&gt;</description></item><item><title>sql_variant in SQL Server and ANYDATA Type in Oracle &amp;laquo; Systems Engineering and RDBMS</title><link>http://sqlblogcasts.com/blogs/madhivanan/archive/2009/02/20/sql-variant-datatype-and-behaviour-changes.aspx#11408</link><pubDate>Fri, 06 Mar 2009 00:20:02 GMT</pubDate><guid isPermaLink="false">fa8c4e8e-46a3-4193-8264-2c1a9cb3475d:11408</guid><dc:creator>sql_variant in SQL Server and ANYDATA Type in Oracle « Systems Engineering and RDBMS</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;sql_variant in SQL Server and ANYDATA Type in Oracle &amp;amp;laquo; Systems Engineering and RDBMS&lt;/p&gt;
&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=11408" width="1" height="1"&gt;</description></item></channel></rss>