<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-8456291897050186888</atom:id><lastBuildDate>Fri, 01 Nov 2024 10:40:02 +0000</lastBuildDate><category>Vijaya Kadiyala</category><category>SQL Server</category><category>DotNetVJ</category><category>SQL Server Tips</category><category>SQL</category><category>ASP.NET 2.0</category><category>SQL Database</category><category>ASP.NET</category><category>.NET</category><category>C#</category><category>T-SQL</category><category>Visual Studio 2008</category><category>net Framework</category><category>Interview</category><category>Code Snips</category><category>MVP Award</category><category>60 seconds</category><category>ADO.NET 2.0</category><category>SQL Server 2008</category><category>SQL Table Design</category><category>SQL Tuning</category><category>Validation Controls</category><category>MVP Summit</category><category>Microsoft Award</category><category>VS.NET</category><category>Constraints</category><category>Interviews</category><category>MVP Summit 2009</category><category>SQL Undocumented</category><category>AJAX</category><category>Debug</category><category>Dotnetspider</category><category>XML</category><category>career</category><category>C# Interview Questions</category><category>Indexes</category><category>Logging</category><category>MVP</category><category>VB.Net</category><category>.NET 3.0</category><category>.Net Testing</category><category>Abhishek Kant</category><category>Best Practices</category><category>Caching</category><category>DTS</category><category>Indexs</category><category>Joins</category><category>Joke</category><category>Microsoft Campus</category><category>News</category><category>Page 3</category><category>Page Life Cycle</category><category>Pinal dave</category><category>SilverLight</category><category>Suprotim Agarwal</category><category>WCF</category><category>Web Services</category><category>.NET Building Blocks</category><category>.NET Framework 2.0</category><category>.Net framework</category><category>Analytical Functions</category><category>Andy Warren</category><category>Bulk Insert</category><category>C-SharpCorner</category><category>CLR</category><category>COALESCE</category><category>Compare Tables</category><category>Computed Columns</category><category>Data Model</category><category>Design</category><category>Features of VS2008</category><category>GO</category><category>Glenn Berry</category><category>Hibernate</category><category>IIS</category><category>INSTR in SQL Server</category><category>ISNULL</category><category>Impersonation</category><category>Inerview Questions</category><category>Itzik Ben-Gan</category><category>JSON</category><category>Jacob Sebastian</category><category>Katmai</category><category>LOCK</category><category>Large Objects</category><category>Limno</category><category>Mahesh Patil</category><category>Microsoft Certification</category><category>ODP.NET</category><category>OOPS</category><category>Open Source .Net</category><category>Partial Class</category><category>Performance</category><category>Ravi Patel</category><category>Reverse</category><category>Ross Mistry</category><category>S</category><category>SMS</category><category>SQL Server Central</category><category>SQL Tree</category><category>SSIS</category><category>Satya</category><category>SiteMinder</category><category>Space Needle</category><category>State Management</category><category>Steve Jones</category><category>StringBuilder</category><category>VC++</category><category>Windows</category><category>XSD</category><category>net Frameword</category><category>umbraco</category><title>Me &amp;amp; My Little Techie.......</title><description>A place to learn from Little Techie...&#xa;Little Techie who is Microsoft Most Valuable Professional (MVP), Most Valuable Contributor (MVC), Most Valuable Member (MVM), Member of the Year..........</description><link>http://dotnetvj.blogspot.com/</link><managingEditor>noreply@blogger.com (Vijaya Kadiyala)</managingEditor><generator>Blogger</generator><openSearch:totalResults>503</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8456291897050186888.post-5135457106328887447</guid><pubDate>Thu, 11 Feb 2010 03:28:00 +0000</pubDate><atom:updated>2010-02-10T22:28:00.232-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">DotNetVJ</category><category domain="http://www.blogger.com/atom/ns#">SQL Server</category><category domain="http://www.blogger.com/atom/ns#">Vijaya Kadiyala</category><title>Extract Just Time from DATETIME data type in SQL Server 2000, SQL Server 2005 and SQL Server 2008</title><description>In this post i would like to list out the various methods to extract the time from DATETIME data type in SQL Server. Depends on the version of the SQL Server you need to&amp;nbsp;use different methods. In SQL Server 2008 you can use any of these methods but in SQL Server 2005 and SQL Server 2000 only method 1,2 and 3 will work.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #351c75;&quot;&gt;DECLARE @DT DATETIME&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #351c75;&quot;&gt;SET @DT = GETDATE()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;strong&gt;-- Method 1:&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #351c75;&quot;&gt;SELECT CONVERT(VARCHAR(30),@DT,114)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;/span&gt;------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
22:31:43:047&lt;br /&gt;
(1 row(s) affected)&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;strong&gt;-- Method 2:&lt;/strong&gt;&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color: #351c75;&quot;&gt;SELECT CAST(@DT AS TIME) &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;/span&gt;----------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
22:31:43.0470000&lt;br /&gt;
(1 row(s) affected)&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;strong&gt;-- Method 3:&lt;/strong&gt;&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color: #351c75;&quot;&gt;SELECT DATEADD(DAY, DATEDIFF(DAY, @dt, 0), @dt)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;/span&gt;-----------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1900-01-01 22:31:43.047&lt;br /&gt;
(1 row(s) affected)&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;strong&gt;-- Method 4:&lt;/strong&gt;&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color: #351c75;&quot;&gt;SELECT @DT - CAST(FLOOR(CAST(@DT AS FLOAT)) AS DATETIME)&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;Output:&lt;/strong&gt;&lt;br /&gt;
-----------------------&lt;br /&gt;
&lt;br /&gt;
1900-01-01 22:31:43.047&lt;br /&gt;
(1 row(s) affected)&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Reference : Vijaya Kadiyala (&lt;/strong&gt;&lt;a href=&quot;http://www.dotnetvj.com/&quot;&gt;&lt;strong&gt;www.DotNetVJ.com&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;)&lt;/strong&gt;</description><link>http://dotnetvj.blogspot.com/2010/02/extract-just-time-from-datetime-data.html</link><author>noreply@blogger.com (Vijaya Kadiyala)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8456291897050186888.post-4688466516505250935</guid><pubDate>Thu, 11 Feb 2010 01:59:00 +0000</pubDate><atom:updated>2010-02-10T20:59:00.168-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">DotNetVJ</category><category domain="http://www.blogger.com/atom/ns#">SQL Server</category><category domain="http://www.blogger.com/atom/ns#">Vijaya Kadiyala</category><title>sargable vs non-sargable queries</title><description>&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;A condition in a query is said to be sargable if the SQL Server can take the advantage of an index to speed up the execution of the query (using index seeks, not covering indexes). sargable stands for &lt;strong&gt;S&lt;/strong&gt;earch &lt;strong&gt;ARG&lt;/strong&gt;ument &lt;strong&gt;Able&lt;/strong&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;strong&gt;Non-sargable search arguments in the WHERE clause are:&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;IS NULL&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&quot;&amp;lt;&amp;gt;&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;NOT&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;NOT EXISTS&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;NOT IN&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;NOT LIKE&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;LIKE &#39;%something&#39; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;In a query if you have mix of Non-sargable and Sargable conditions then SQL Server might use covering index based on the columns used in SELECT Clause, WHERE Clause and JOIN clause. These covering indexes sometimes may not be appropriate to the query and can increase disk I/O. In adidtion to this, try to avoid using any functions on Indexed columns.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;strong&gt;Non-sargable Query:&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;SELECT FirstName,LastName FROM Person.Person WHERE LEFT(LastName,2) = &#39;Ma&#39;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;strong&gt;Sargable Query:&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;SELECT FirstName,LastName FROM Person.Person WHERE LastName LIKE &#39;Ma%&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Both of these queries produce the same result but the first one is non-sargable and will run little slow compared to the second one which is sargable.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;strong&gt;Reference : Vijaya Kadiyala (&lt;/strong&gt;&lt;a href=&quot;http://www.dotnetvj.com/&quot;&gt;&lt;strong&gt;www.DotNetVJ.com&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;</description><link>http://dotnetvj.blogspot.com/2010/02/sargable-vs-non-sargable-queries.html</link><author>noreply@blogger.com (Vijaya Kadiyala)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8456291897050186888.post-1808252984351515689</guid><pubDate>Wed, 10 Feb 2010 02:18:00 +0000</pubDate><atom:updated>2010-02-09T21:19:37.221-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">DotNetVJ</category><category domain="http://www.blogger.com/atom/ns#">SQL Server</category><category domain="http://www.blogger.com/atom/ns#">Vijaya Kadiyala</category><title>DATEDIFF Function in SQL Server</title><description>In this post i would like to show you to find the difference between two dates using DATEDIFF in SQL Server.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Syntax: &lt;/strong&gt;DateDiff(DatePart, StartDate, EndDate)&lt;br /&gt;
&lt;br /&gt;
DatePart is the parameter on which SQL Server calculates the difference between two input dates i.e. startdate and enddate.&lt;br /&gt;
&lt;br /&gt;
Please refer to the below table:&lt;br /&gt;
Datepart Abbreviations &lt;br /&gt;
&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;th&gt;DatePart&lt;/th&gt;&lt;th&gt;Abbreviations&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Year&lt;/td&gt;&lt;td&gt;yy, yyyy&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;quarter&lt;/td&gt;&lt;td&gt;qq, q&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Month&lt;/td&gt;&lt;td&gt;mm, m&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;dayofyear&lt;/td&gt;&lt;td&gt;dy, y&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Day&lt;/td&gt;&lt;td&gt;dd, d&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Week&lt;/td&gt;&lt;td&gt;wk, ww&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Hour&lt;/td&gt;&lt;td&gt;hh&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;minute&lt;/td&gt;&lt;td&gt;mi, n&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;second&lt;/td&gt;&lt;td&gt;ss, s&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;millisecond&lt;/td&gt;&lt;td&gt;ms&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;strong&gt;Ex: To calculate the difference between two dates (No Of Days)&lt;/strong&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;SELECT DATEDIFF(DAY,&#39;2001-01-01&#39;,&#39;2010-01-01&#39;)&amp;nbsp;AS No_Of_Days_Difference&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;Output:&lt;/strong&gt;&lt;br /&gt;
No_Of_Days_Difference&lt;br /&gt;
&lt;br /&gt;
---------------------&lt;br /&gt;
3287&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Ex: To calculate the difference between two dates (No Of&amp;nbsp; Years)&lt;/strong&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;SELECT&amp;nbsp;DATEDIFF(YEAR,&#39;2001-01-01&#39;,&#39;2010-01-01&#39;)&amp;nbsp;AS No_Of_Years_Difference&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: black;&quot;&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;No_Of_Years_Difference&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;---------------------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;9&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Ex: To calculate the difference between two dates (No Of Months)&lt;/strong&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;SELECT DATEDIFF(MONTH,&#39;2001-01-01&#39;,&#39;2010-01-01&#39;) AS No_Of_Months_Difference&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;No_Of_Months_Difference&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;---------------------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;108&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Reference : Vijaya Kadiyala(&lt;/strong&gt;&lt;a href=&quot;http://www.dotnetvj.com/&quot;&gt;&lt;strong&gt;www.DotNetVJ.com&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;)&lt;/strong&gt;</description><link>http://dotnetvj.blogspot.com/2010/02/datediff-function-in-sql-server.html</link><author>noreply@blogger.com (Vijaya Kadiyala)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8456291897050186888.post-7554066202217456244</guid><pubDate>Tue, 09 Feb 2010 03:13:00 +0000</pubDate><atom:updated>2010-02-08T22:13:34.819-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">DotNetVJ</category><category domain="http://www.blogger.com/atom/ns#">Vijaya Kadiyala</category><title>DotNetVJ News - 500th Article</title><description>&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;This is my 500th article and&amp;nbsp;I very happy and excited about it. I started this blogging on 18-NOV-2007 to share my knowledge and build my own repository of what&amp;nbsp;I am working on. I started this blog on .Net and then slowly started writing articles on SQL Server, PowerShell and MS Office Tips and Tricks. During this course of blogging i was awarded Microsoft Most Valuable Professional in ASP.NET (2008-2009) and in SQL Server (2009-2010). I am very happy and will continue to share my knowledge.&lt;/span&gt;</description><link>http://dotnetvj.blogspot.com/2010/02/dotnetvj-news-500th-article.html</link><author>noreply@blogger.com (Vijaya Kadiyala)</author><thr:total>5</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8456291897050186888.post-432813638904144815</guid><pubDate>Thu, 04 Feb 2010 13:59:00 +0000</pubDate><atom:updated>2010-02-04T08:59:00.113-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">DotNetVJ</category><category domain="http://www.blogger.com/atom/ns#">SQL Server</category><category domain="http://www.blogger.com/atom/ns#">Vijaya Kadiyala</category><title>Find the Database creation date (DATABASE AGE) in SQL Server</title><description>In this post i would like to show you simple tip to find when the database created.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;SELECT name,crdate&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;FROM master..sysdatabases&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Database-&amp;gt;Date Of Creation&lt;br /&gt;
&lt;br /&gt;
-------------------------------&lt;br /&gt;
master-&amp;gt; Apr 8 2003 9:13AM&lt;br /&gt;
tempdb-&amp;gt; Jan 29 2010 9:22PM&lt;br /&gt;
model-&amp;gt; Apr 8 2003 9:13AM&lt;br /&gt;
msdb-&amp;gt; Jul 9 2008 4:46PM&lt;br /&gt;
AdventureWorks-&amp;gt; Aug 31 2009 9:49AM&lt;br /&gt;
AdventureWorksDW-&amp;gt; Aug 31 2009 9:50AM&lt;br /&gt;
AdventureWorksLT-&amp;gt; Aug 31 2009 9:50AM&lt;br /&gt;
AdventureWorks2008-&amp;gt; Aug 31 2009 9:50AM&lt;br /&gt;
AdventureWorksDW2008-&amp;gt; Aug 31 2009 9:51AM&lt;br /&gt;
AdventureWorksLT2008-&amp;gt; Aug 31 2009 9:51AM&lt;br /&gt;
&lt;br /&gt;
(13 row(s) affected)&lt;br /&gt;
&lt;br /&gt;
Please let me know if you have any other way to find the same information...</description><link>http://dotnetvj.blogspot.com/2010/02/find-database-creation-date-database.html</link><author>noreply@blogger.com (Vijaya Kadiyala)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8456291897050186888.post-6064289045643892848</guid><pubDate>Thu, 04 Feb 2010 01:36:00 +0000</pubDate><atom:updated>2010-02-03T20:36:03.042-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">DotNetVJ</category><category domain="http://www.blogger.com/atom/ns#">SQL Server</category><category domain="http://www.blogger.com/atom/ns#">Vijaya Kadiyala</category><title>Table Scan Vs Index Scan in SQL Server</title><description>Today i would like to clarify the difference between the Index Scan and Table Scan.&lt;br /&gt;
&lt;br /&gt;
A table scan, table is processed row by row from start to end. In the index scan, index is processed row by row from&amp;nbsp;start to end. &lt;br /&gt;
&lt;br /&gt;
If the index is a clustered index then an index scan is really a table scan.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Reference : Vijaya Kadiyala (&lt;/strong&gt;&lt;a href=&quot;http://www.dotnetvj.com/&quot;&gt;&lt;strong&gt;www.DotNetVJ.com&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;)&lt;/strong&gt;</description><link>http://dotnetvj.blogspot.com/2010/02/table-scan-vs-index-scan-in-sql-server.html</link><author>noreply@blogger.com (Vijaya Kadiyala)</author><thr:total>3</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8456291897050186888.post-6404106364068253883</guid><pubDate>Wed, 03 Feb 2010 02:28:00 +0000</pubDate><atom:updated>2010-02-02T21:28:59.584-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">DotNetVJ</category><category domain="http://www.blogger.com/atom/ns#">SQL Server</category><category domain="http://www.blogger.com/atom/ns#">Vijaya Kadiyala</category><title>Convert list of values seperated by comma stored in a column into Multiple Rows in SQL Server</title><description>Today, I would like to give you simple tip to convert list of values seperated by comma stored in a column into Multiple Rows in SQL Server. &lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Verdana, sans-serif;&quot;&gt;declare @String varchar(MAX)&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Verdana, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Verdana, sans-serif;&quot;&gt;set @String = &#39;100,200,250,300,350,450,500&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Verdana, sans-serif;&quot;&gt;set @String =&#39;,&#39;+ @String + &#39;,&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Verdana, sans-serif;&quot;&gt;SELECT REPLACE(Val_Column,&#39;,&#39;,&#39;&#39;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Verdana, sans-serif;&quot;&gt;FROM&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Verdana, sans-serif;&quot;&gt;(&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Verdana, sans-serif;&quot;&gt;select&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Verdana, sans-serif;&quot;&gt;substring(@String,number,CHARINDEX(&#39;,&#39;,@String,number+1)-number) As Val_Column&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Verdana, sans-serif;&quot;&gt;from&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Verdana, sans-serif;&quot;&gt;master..spt_values &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Verdana, sans-serif;&quot;&gt;where number &amp;lt; LEN(@String) &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Verdana, sans-serif;&quot;&gt;and type = &#39;P&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Verdana, sans-serif;&quot;&gt;) C&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Verdana, sans-serif;&quot;&gt;where Val_Column like &#39;,%&#39;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: black; font-family: Verdana;&quot;&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
--------------------------------------&lt;br /&gt;
100&lt;br /&gt;
200&lt;br /&gt;
250&lt;br /&gt;
300&lt;br /&gt;
350&lt;br /&gt;
450&lt;br /&gt;
500&lt;br /&gt;
&lt;br /&gt;
(7 row(s) affected)</description><link>http://dotnetvj.blogspot.com/2010/02/convert-list-of-values-seperated-by.html</link><author>noreply@blogger.com (Vijaya Kadiyala)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8456291897050186888.post-3953141096709318564</guid><pubDate>Mon, 01 Feb 2010 18:02:00 +0000</pubDate><atom:updated>2010-02-01T13:02:37.490-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">DotNetVJ</category><category domain="http://www.blogger.com/atom/ns#">SQL Server</category><category domain="http://www.blogger.com/atom/ns#">Vijaya Kadiyala</category><title>Split Full Name into First Name, Middle Name, Last Name in SQL Server using PARSENAME function</title><description>In this post i would like to show you a simple technique to split the full name. There are various techniques available to do the same using LEFT, RIGHT,SUBSTRING, CHARINDEX functions.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #0b5394; font-family: inherit;&quot;&gt;DECLARE @SQLVariable VARCHAR(100);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394; font-family: inherit;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394; font-family: inherit;&quot;&gt;SET @SQLVariable = &#39;Vijaya.Krishna.Kadiyala.SQL Server&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394; font-family: inherit;&quot;&gt;select PARSENAME(@SQLVariable,1) AS Technical_Skill;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394; font-family: inherit;&quot;&gt;select PARSENAME(@SQLVariable,2) AS LAST_NAME;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394; font-family: inherit;&quot;&gt;select PARSENAME(@SQLVariable,3) AS MIDDLE_NAME;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394; font-family: inherit;&quot;&gt;select PARSENAME(@SQLVariable,4) AS FIRST_NAME;&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Output:&lt;/strong&gt;&lt;br /&gt;
Technical_Skill&lt;br /&gt;
&lt;br /&gt;
-----------------&lt;br /&gt;
SQL Server&lt;br /&gt;
(1 row(s) affected)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
LAST_NAME&lt;br /&gt;
-------------------&lt;br /&gt;
Kadiyala&lt;br /&gt;
(1 row(s) affected)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
MIDDLE_NAME&lt;br /&gt;
-------------------&lt;br /&gt;
Krishna&lt;br /&gt;
&lt;br /&gt;
(1 row(s) affected)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
FIRST_NAME&lt;br /&gt;
-------------------&lt;br /&gt;
Vijaya&lt;br /&gt;
&lt;br /&gt;
(1 row(s) affected)&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Reference : Vijaya Kadiyala (&lt;/strong&gt;&lt;a href=&quot;http://www.dotnetvj.com/&quot;&gt;&lt;strong&gt;www.DotNetVJ.com&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;)&lt;/strong&gt;</description><link>http://dotnetvj.blogspot.com/2010/02/split-full-name-into-first-name-middle.html</link><author>noreply@blogger.com (Vijaya Kadiyala)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8456291897050186888.post-1696333273467951860</guid><pubDate>Fri, 29 Jan 2010 00:34:00 +0000</pubDate><atom:updated>2010-01-28T20:23:09.795-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">DotNetVJ</category><category domain="http://www.blogger.com/atom/ns#">SQL Server</category><category domain="http://www.blogger.com/atom/ns#">Vijaya Kadiyala</category><title>Convert Number to Varchar in SQL Server using CAST or CONVERT or STR or Any other String Functions</title><description>Recently i started to explpore &quot;ways&quot; in SQL Server.&lt;br /&gt;&lt;strong&gt;Ways in SQL Server:&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;===============&lt;/strong&gt;&lt;br /&gt;&lt;a href=&quot;http://www.dotnetvj.com/2009/08/implementation-of-not-in-operator-with.html&quot;&gt;Implementation of NOT IN operator with out using NOT IN....&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://www.dotnetvj.com/2009/05/top-5-ways-to-delete-duplicate-records.html&quot;&gt;TOP 5 ways to delete Duplicate Records in a Table&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;In the same series today i would like to show you different ways to convert number to varchar.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Using CAST Function:&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;=================&lt;/strong&gt;&lt;br /&gt;SELECT CAST(YEAR(GETDATE()) AS VARCHAR)&lt;br /&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;br /&gt;----&lt;br /&gt;2010&lt;br /&gt;(1 row(s) affected)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Using CONVERT Function:&lt;/strong&gt;&lt;br /&gt;======================&lt;br /&gt;SELECT CONVERT(VARCHAR(4),YEAR(GETDATE()))&lt;br /&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;br /&gt;----&lt;br /&gt;2010&lt;br /&gt;(1 row(s) affected)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Using STR String Function:&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;=====================&lt;/strong&gt;&lt;br /&gt;SELECT STR(YEAR(GETDATE()))&lt;br /&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;br /&gt;----&lt;br /&gt;2010&lt;br /&gt;(1 row(s) affected)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Using RTRIM or LTRIM Functions:&lt;/strong&gt;&lt;br /&gt;=============================&lt;br /&gt;SELECT RTRIM(YEAR(GETDATE()))&lt;br /&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;br /&gt;----&lt;br /&gt;2010&lt;br /&gt;(1 row(s) affected)&lt;br /&gt;&lt;br /&gt;When you apply any string functions on the numbers then by default SQL Server converts them to string data type.&lt;br /&gt;&lt;br /&gt;Please let me know if you have any other ways.....&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Related Articles:&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;============&lt;/strong&gt;&lt;br /&gt;&lt;a href=&quot;http://www.dotnetvj.com/2009/05/string-functions-in-sql-server-part-1.html&quot;&gt;String Functions in SQL Server Part 1&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://www.dotnetvj.com/2009/05/string-functions-in-sql-server-final.html&quot;&gt;String Functions in SQL Server -- Final Part&lt;/a&gt;</description><link>http://dotnetvj.blogspot.com/2010/01/convert-number-to-varchar-in-sql-server.html</link><author>noreply@blogger.com (Vijaya Kadiyala)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8456291897050186888.post-7204235746612268019</guid><pubDate>Wed, 27 Jan 2010 15:32:00 +0000</pubDate><atom:updated>2010-01-27T15:47:24.251-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">DotNetVJ</category><category domain="http://www.blogger.com/atom/ns#">SQL Server</category><category domain="http://www.blogger.com/atom/ns#">Vijaya Kadiyala</category><title>Search For Columns in SQL Server</title><description>In this post i would like to show you various methods to search for columns in SQL Server metadata tables.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Method 1:&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;========&lt;/strong&gt;&lt;br /&gt;&lt;span style=&quot;color:#3333ff;&quot;&gt;&lt;blockquote&gt;&lt;span style=&quot;color:#3333ff;&quot;&gt;SELECT TABLE_SCHEMA,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#3333ff;&quot;&gt;TABLE_NAME, &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#3333ff;&quot;&gt;COLUMN_NAME&lt;br /&gt;FROM&lt;br /&gt;INFORMATION_SCHEMA.COLUMNS &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#3333ff;&quot;&gt;WHERE COLUMN_NAME LIKE&lt;br /&gt;&#39;%emp%&#39;;&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Method 2:&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;========&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#3366ff;&quot;&gt;&lt;blockquote&gt;&lt;span style=&quot;color:#3366ff;&quot;&gt;SELECT OBJECT_SCHEMA_NAME(object_id) AS SCHEMANAME,&lt;br /&gt;OBJECT_NAME(object_id) OBJECTNAME,&lt;br /&gt;name as column_name&lt;br /&gt;FROM&lt;br /&gt;sys.columns &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#3366ff;&quot;&gt;WHERE name LIKE &#39;%emp%&#39;;&lt;/span&gt; &lt;/blockquote&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#3366ff;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;I normally use &lt;strong&gt;Method 1&lt;/strong&gt;, to find the information. Please let me know if you have any other approach.....&lt;/span&gt;</description><link>http://dotnetvj.blogspot.com/2010/01/search-for-columns-in-sql-server.html</link><author>noreply@blogger.com (Vijaya Kadiyala)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8456291897050186888.post-363412593876234753</guid><pubDate>Tue, 26 Jan 2010 16:02:00 +0000</pubDate><atom:updated>2010-01-26T11:15:45.734-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">DotNetVJ</category><category domain="http://www.blogger.com/atom/ns#">SQL Server</category><category domain="http://www.blogger.com/atom/ns#">Vijaya Kadiyala</category><title>Is Your MONEY Safe in SQL Server</title><description>In this post i would like to share my experience with you on MONEY data type in SQL Server .&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Let’s looks at one example where MONEY data type will round numbers.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Usage of MONEY data type in storing amounts&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style=&quot;color:#3333ff;&quot;&gt;DECLARE @Money_Amt1 MONEY, @Money_Amt2 MONEY&lt;br /&gt;&lt;br /&gt;SET @Money_Amt1 = 100100.1234567;&lt;br /&gt;SET @Money_Amt2 = 100100.1234;&lt;br /&gt;&lt;br /&gt;SELECT @Money_Amt1 AS Money_Amt1,&lt;br /&gt;@Money_Amt2 AS Money_Amt2;&lt;/span&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5431082112401694546&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 327px; CURSOR: hand; HEIGHT: 112px; TEXT-ALIGN: center&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheWwcSsNcPho1umcbeqmKN-nxGsV6neB_6DdcgwlxRkyMh4X1_8ztaXJXbdNp9i8nXvMiVLxYD7_4E4k4uk6wRdT20RemgPxkqif8ZsDWYARIF5GplNZNXwm6E7UFmu0iVRIMXamHDYGQh/s400/12.JPG&quot; border=&quot;0&quot; /&gt;&lt;br /&gt;&lt;br /&gt;As you can see Money data type can hold only up to 4 digits after the decimal. If you are trying to assign a number whose scale is more than 4 digits, then money data type rounds the number, in which case over the course of the time you will accumulate lot of in correct amounts. So you need to make right decision in choosing the right data type for your data.&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;FYI: This is not a bug neither this is the limitation.&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Let’s look at one example where you want to multiply two MONEY data type variables .&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Usage of MONEY data type in Multiplication&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style=&quot;color:#3333ff;&quot;&gt;DECLARE @Your_Money MONEY, @Currency_Conversion_Rate MONEY;&lt;br /&gt;&lt;br /&gt;SET @Your_Money = 12.2345;&lt;br /&gt;SET @Currency_Conversion_Rate = 18.7686;&lt;br /&gt;&lt;br /&gt;SELECT (@Your_Money * @Currency_Conversion_Rate) AS Col1,&lt;br /&gt;(@Your_Money * 1.0 * @Currency_Conversion_Rate) AS Col2;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5431081787462121250&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 290px; CURSOR: hand; HEIGHT: 112px; TEXT-ALIGN: center&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRybHbtMgZ7UpXz5pKrzJx4TzEhl0hd3DV9Aq9Wr4nqlNG6dY0H-5msNc2FK9nR_jrzLg7fsI7aVtDozrOkvGAhw_2lSxxGYeZJwoqUnv1u51dXj-TPsyuW3fd97giBIYmFTtV1GNNc0XI/s400/11.JPG&quot; border=&quot;0&quot; /&gt;&lt;br /&gt;As you can see in the above query, I declared two variables. The result of the multiplication or division of two money data type is always money. As discussed previously money data type can hold only 4 digits after the decimal and if it is anything more than that it tries to round to the nearest number. As you can see in the Col1, you don’t see the accurate results of the multiplication operation and whereas in the Col2 by multiplying with 1.0, basically SQL Server is converting into numeric.</description><link>http://dotnetvj.blogspot.com/2010/01/is-your-money-safe-in-sql-server.html</link><author>noreply@blogger.com (Vijaya Kadiyala)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheWwcSsNcPho1umcbeqmKN-nxGsV6neB_6DdcgwlxRkyMh4X1_8ztaXJXbdNp9i8nXvMiVLxYD7_4E4k4uk6wRdT20RemgPxkqif8ZsDWYARIF5GplNZNXwm6E7UFmu0iVRIMXamHDYGQh/s72-c/12.JPG" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8456291897050186888.post-4900492301749072501</guid><pubDate>Wed, 20 Jan 2010 20:55:00 +0000</pubDate><atom:updated>2010-01-20T16:14:41.402-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">DotNetVJ</category><category domain="http://www.blogger.com/atom/ns#">SQL Server</category><category domain="http://www.blogger.com/atom/ns#">Vijaya Kadiyala</category><title>Order By Clause is not accepting alias Name in SQL Server</title><description>&lt;span style=&quot;font-family:verdana;font-size:85%;&quot;&gt;Today, i came across a strange behaviour of ORDER BY clause in SQL Server. In one of my post i mentioned that &lt;a href=&quot;http://www.dotnetvj.com/2009/07/processing-order-of-select-statement.html&quot;&gt;&lt;strong&gt;ORDER BY clause is final step in the SQL Query&lt;/strong&gt;&lt;/a&gt; if you don&#39;t have TOP keyword in the query.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;&quot;&gt;Lets look at the below example:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;color:#3333ff;&quot;&gt;SELECT&lt;br /&gt;BusinessEntityID,&lt;br /&gt;LoginID,&lt;br /&gt;HireDate,&lt;br /&gt;GETDATE() AS Current_Dt&lt;br /&gt;FROM HumanResources.Employee&lt;br /&gt;ORDER BY Current_Dt&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;color:#3333ff;&quot;&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;color:#000000;&quot;&gt;In this query i have an alias name in the ORDER BY Clause and SQL Server executes the query with out any errors as shown below:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5428930955148034658&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 223px; TEXT-ALIGN: center&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnKcZcakvEvr6AMV6YmFvoICXMeYd5cKuorm0xl_rO_eSSYZ9GneTJZUnRBZp5qKV27dGj0y-VzF0gblDSk5JD99Z6Y2-ITl17lMQuHyb8WzOEyi6nWtWJisTxETpzBCeE5zpAIwtcXxty/s400/11.JPG&quot; border=&quot;0&quot; /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;&quot;&gt;Now If i use any functions on the alias column in the ORDER BY clause, it comes out with errors:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;color:#3333ff;&quot;&gt;SELECT BusinessEntityID,&lt;br /&gt;LoginID,&lt;br /&gt;HireDate,&lt;br /&gt;GETDATE() AS Current_Dt&lt;br /&gt;FROM HumanResources.Employee&lt;br /&gt;ORDER BY ABS(DATEDIFF(DAY,Current_Dt,HireDate));&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;color:#3333ff;&quot;&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5428931422076098226&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 145px; TEXT-ALIGN: center&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqp25WIwLZoOWsb0Rea0Bnv5LsPOhHuel5kl1c9tTOjQMZniwXRYRYGGMUQ0KODEm8lnI68VVN9y4y4DASY_QwASjBDr-VzO3dj7D6MTGUqoUNM_HaP_2zDN-ypR2E8JB8vOzW8mb1a2EC/s400/12.JPG&quot; border=&quot;0&quot; /&gt; &lt;/span&gt;&lt;strong&gt;&lt;span style=&quot;color:#3333ff;&quot;&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;p&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;&quot;&gt;Do let me know if you have any answer to this question.... &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;&quot;&gt;Reference : Vijaya Kadiyala (&lt;/span&gt;&lt;/strong&gt;&lt;a href=&quot;http://www.dotnetvj.com/&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;&quot;&gt;www.DotNetVJ.com&lt;/span&gt;&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;&quot;&gt;)&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;&quot;&gt;&lt;/span&gt;</description><link>http://dotnetvj.blogspot.com/2010/01/order-by-clause-can-not-accept-alias.html</link><author>noreply@blogger.com (Vijaya Kadiyala)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnKcZcakvEvr6AMV6YmFvoICXMeYd5cKuorm0xl_rO_eSSYZ9GneTJZUnRBZp5qKV27dGj0y-VzF0gblDSk5JD99Z6Y2-ITl17lMQuHyb8WzOEyi6nWtWJisTxETpzBCeE5zpAIwtcXxty/s72-c/11.JPG" height="72" width="72"/><thr:total>7</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8456291897050186888.post-590903141657757528</guid><pubDate>Wed, 20 Jan 2010 20:13:00 +0000</pubDate><atom:updated>2010-01-20T15:23:47.562-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">DotNetVJ</category><category domain="http://www.blogger.com/atom/ns#">SQL Server</category><category domain="http://www.blogger.com/atom/ns#">Vijaya Kadiyala</category><title>Intellisense update/refresh on schema changes - SQL Server</title><description>&lt;p&gt;The intellisense in SQL Server 2008 is a great feature but sometimes you might get into trouble with it. As an example, If you make any change like creating a new table or column name change etc, while SSMS is open those changes are not reflected in current or even new query editor window in that instance of SSMS. &lt;/p&gt;&lt;p&gt;If you close the instance and launch SSMS again then you can see the changes. So for every change you don&#39;t want to close and re-open. So here is the tip, Just refresh your local cache then it will work.&lt;/p&gt;&lt;p&gt;You can refresh you &lt;strong&gt;local cache&lt;/strong&gt; by going to Edit-&gt;IntelliSense-&gt;Refresh Local Cache or simple using short cut (CTRL+Shift+R)&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Reference : Vijaya Kadiyala&lt;/strong&gt; (&lt;a href=&quot;http://www.dotnetvj.com/&quot;&gt;www.DotNetVJ.com&lt;/a&gt;)&lt;/p&gt;&lt;p&gt; &lt;/p&gt;</description><link>http://dotnetvj.blogspot.com/2010/01/intellisense-updaterefresh-on-schema.html</link><author>noreply@blogger.com (Vijaya Kadiyala)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8456291897050186888.post-3009169291794956169</guid><pubDate>Tue, 19 Jan 2010 02:28:00 +0000</pubDate><atom:updated>2010-01-18T21:48:11.982-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">DotNetVJ</category><category domain="http://www.blogger.com/atom/ns#">SQL Server</category><category domain="http://www.blogger.com/atom/ns#">Vijaya Kadiyala</category><title>Get the records nearest to GETDATE() in SQL Server</title><description>In this post i would like to show you different ways to find the rows nearest to the GetDate() in SQL Server.&lt;br /&gt;&lt;br /&gt;Method 1, is based on calculating the difference interims of days between GetDate() and HireDate and then take the absolute number using ABS. Order these results in ascending (ASC)order by using ORDER BY Clauase. Finally, filter the results using TOP 1 WITH TIES. WITH TIES is used to select all the records when there is a tie.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;color:#009900;&quot;&gt;Method 1:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;color:#009900;&quot;&gt;=======&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;color:#00cccc;&quot;&gt;SELECT TOP 1 WITH TIES&lt;br /&gt;BusinessEntityID,&lt;br /&gt;LoginID,&lt;br /&gt;HireDate,&lt;br /&gt;GETDATE() AS [Current_Date]&lt;br /&gt;FROM HumanResources.Employee&lt;br /&gt;ORDER BY ABS(DATEDIFF(DAY,GETDATE(),HireDate));&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;color:#00cccc;&quot;&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Method 2, is based on using Group Functions. Where MAX function is used to take the recent date and based on this date extracted all the other information.&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;color:#00cccc;&quot;&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;color:#009900;&quot;&gt;Method 2:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;color:#009900;&quot;&gt;=======&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;color:#339999;&quot;&gt;SELECT&lt;br /&gt;BusinessEntityID,&lt;br /&gt;LoginID,&lt;br /&gt;HireDate&lt;br /&gt;FROM HumanResources.Employee&lt;br /&gt;WHERE HireDate = (SELECT MAX(HireDate) FROM HumanResources.Employee)&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;color:#339999;&quot;&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Method 3, is based on Analytical Functions in SQL Server. Where RANK function is used to &lt;/span&gt;&lt;br /&gt;along with the OVER BY to calculate the difference between GetDate and HireDate. This logic is same as in Method 1.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;color:#009900;&quot;&gt;Method 3:&lt;br /&gt;=======&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;color:#00cccc;&quot;&gt;SELECT V.* FROM&lt;br /&gt;(SELECT&lt;br /&gt;BusinessEntityID,&lt;br /&gt;LoginID,&lt;br /&gt;HireDate,&lt;br /&gt;RANK() OVER (ORDER BY ABS(DATEDIFF(DAY,GETDATE(),HireDate))) AS RecID&lt;br /&gt;FROM HumanResources.Employee ) V&lt;br /&gt;WHERE V.RecID = 1&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;color:#00cccc;&quot;&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Please let me know if you have any other ways to wirte these queries.....&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;color:#00cccc;&quot;&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;color:#00cccc;&quot;&gt;Reference : Vijaya Kadiyala (&lt;a href=&quot;http://www.dotnetvj.com/&quot;&gt;http://www.dotnetvj.com/&lt;/a&gt;)&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;color:#00cccc;&quot;&gt;&lt;/span&gt;&lt;/strong&gt;</description><link>http://dotnetvj.blogspot.com/2010/01/get-records-nearest-to-getdate-in-sql.html</link><author>noreply@blogger.com (Vijaya Kadiyala)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8456291897050186888.post-6141251427009944349</guid><pubDate>Sat, 16 Jan 2010 20:52:00 +0000</pubDate><atom:updated>2010-01-16T16:00:39.635-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">DotNetVJ</category><category domain="http://www.blogger.com/atom/ns#">SQL Server</category><category domain="http://www.blogger.com/atom/ns#">Vijaya Kadiyala</category><title>DROP INDEX - Must specify the table name and index name for the DROP INDEX statement</title><description>In this post i would like to show you, how to drop an index in SQL Server.&lt;br /&gt;&lt;br /&gt;If you came from different database backgrounds like Oracle or DB2, then you will issue the following statement and expect to execute without errors.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#3366ff;&quot;&gt;DROP INDEX INDEX_NAME&lt;index_name&gt;; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This will not work in SQL Server. You need to specify the on which table this index is defined.&lt;br /&gt;When you execute the above statement you will get below error:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#cc0000;&quot;&gt;Msg 159, Level 15, State 1, Line 1&lt;br /&gt;Must specify the table name and index name for the DROP INDEX statement.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The right way to drop an index is:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#3366ff;&quot;&gt;DROP INDEX INDEX_NAME &lt;index_name&gt;ON TABLE_NAME&lt;table_name&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#3366ff;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Related Articles:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;a href=&quot;http://www.dotnetvj.com/2009/05/clustered-index-in-sql-server.html&quot;&gt;Clustered Index in SQL Server&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://www.dotnetvj.com/2009/05/non-clustered-index-in-sql-server.html&quot;&gt;Non Clustered Index in SQL Server&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://www.dotnetvj.com/2009/05/covering-index-in-sql-server.html&quot;&gt;Covering Index in SQL Server&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://www.dotnetvj.com/2009/05/filtered-indexes-in-sql-server-2008.html&quot;&gt;Filtered indexes in SQL Server 2008&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Reference: Vijaya Kadiyala (&lt;a href=&quot;http://www.dotnetvj.com/&quot;&gt;www.DotNetVJ.com&lt;/a&gt;)</description><link>http://dotnetvj.blogspot.com/2010/01/drop-index-must-specify-table-name-and.html</link><author>noreply@blogger.com (Vijaya Kadiyala)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8456291897050186888.post-3655443715905362509</guid><pubDate>Fri, 15 Jan 2010 19:16:00 +0000</pubDate><atom:updated>2010-01-15T14:41:04.425-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">DotNetVJ</category><category domain="http://www.blogger.com/atom/ns#">SQL Server</category><category domain="http://www.blogger.com/atom/ns#">Vijaya Kadiyala</category><title>When to use fully qualified names in SQL Server</title><description>In Sql Server each and every object name has four parts.&lt;br /&gt;1. Server Name&lt;br /&gt;2. Database Name&lt;br /&gt;3. Owner Name&lt;br /&gt;4. Object Name&lt;br /&gt;&lt;br /&gt;If you quality Object Name with Server Name, Database Name and Owner then it is referred as Fully Qualified Name.&lt;br /&gt;&lt;br /&gt;Some people believes that if you fully qualify the object name it will improve the performance. But its not true. Depends on the need you need to make a right choice. As an example if your application is using one/single database always then you can write queries as shown below:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;strong&gt;&lt;em&gt;&lt;span style=&quot;color:#3333ff;&quot;&gt;SELECT * FROM HumanResources.Shift&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/blockquote&gt;Sometimes owner name is also referred as Schema. If you take AdventureWorks2008 database, then there are various schemas like HumanResources, Sales, Production, Person etc.&lt;br /&gt;&lt;br /&gt;If you have multiple databases and your queries always joins two or more tables from two or more different databases then it will be good if you qualify with database name as shown below:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style=&quot;color:#3333ff;&quot;&gt;&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;span style=&quot;color:#3333ff;&quot;&gt;SELECT * FROM&lt;br /&gt;AdventureWorks2008.HumanResources.Shift&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;span style=&quot;color:#3333ff;&quot;&gt;SELECT * FROM&lt;br /&gt;VJ_LCL.dbo.emp&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt; &lt;/p&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;VJ_LCL is my local database and the schema owner of emp table is dbo.  Similarly AdventureWorks2008 is database and HumanResources is the schema name and Shift is the table name. Rememeber, object name has to be unique within each schema.&lt;br /&gt;&lt;br /&gt;On the other hand, if you have queries that has joins between two or more tables from two or more different servers then you need to fully qualify the object name as show below:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style=&quot;color:#3333ff;&quot;&gt;&lt;blockquote&gt;&lt;strong&gt;&lt;em&gt;&lt;span style=&quot;color:#3333ff;&quot;&gt;SELECT * FROM&lt;br /&gt;VJMSSQLServer.AdventureWorks2008.HumanResources.Shift&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;If you fully qualify each and every object even when you have single database then you might get into following problems:&lt;br /&gt;&lt;br /&gt;1) If you are planning to change the database, your code will break&lt;br /&gt;2) If you are planning to change the server or deploying it on another server then your code will break.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Reference:&lt;/strong&gt; Vijaya Kadiyala (&lt;a href=&quot;http://dotnetvj.com/&quot;&gt;&lt;strong&gt;http://DotNetVJ.com&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;)&lt;/strong&gt;</description><link>http://dotnetvj.blogspot.com/2010/01/when-to-use-fully-qualified-names-in.html</link><author>noreply@blogger.com (Vijaya Kadiyala)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8456291897050186888.post-6519051232461083218</guid><pubDate>Fri, 15 Jan 2010 18:58:00 +0000</pubDate><atom:updated>2010-01-15T14:07:16.424-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">DotNetVJ</category><category domain="http://www.blogger.com/atom/ns#">SQL Server</category><category domain="http://www.blogger.com/atom/ns#">Vijaya Kadiyala</category><title>Getting  the Server Name in SQL Server using @@SERVERNAME</title><description>In this post i would like to give you a simple tip on how to get the Server Name of the SQL server.&lt;br /&gt;&lt;br /&gt;In order to get the SQL Server - Server name you need to use Global Variable as shown below.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#3366ff;&quot;&gt;SELECT @@SERVERNAME AS Server_Name&lt;/span&gt;</description><link>http://dotnetvj.blogspot.com/2010/01/how-to-get-server-name-in-sql-server.html</link><author>noreply@blogger.com (Vijaya Kadiyala)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8456291897050186888.post-1801790999635195831</guid><pubDate>Thu, 14 Jan 2010 18:57:00 +0000</pubDate><atom:updated>2010-01-14T14:52:08.831-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">DotNetVJ</category><category domain="http://www.blogger.com/atom/ns#">SQL Server</category><category domain="http://www.blogger.com/atom/ns#">Vijaya Kadiyala</category><title>Get Current date and time in SQL Server using CURRENT_TIMESTAMP, GETDATE(), SYSDATETIME()</title><description>In this post i would like to discuss with you about displaying current date and time in SQL Server.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;CURRENT_TIMESTAMP&lt;/strong&gt; is ANSI compliant. This value is based on the operating system where the SQL Server instance is running. This function is nondeterministic function.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;GETDATE()&lt;/strong&gt; is inherited from sybase.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;SYSDATETIME()&lt;/strong&gt;, this value is based on the operating system where the SQL Server instance is running. This function is nondeterministic function. The return type of this function is datetime2. So this is more accurate than any other time based function.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In addition to this there is another way to display the current date and time.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The &lt;strong&gt;{fn Now()}&lt;/strong&gt; is an ODBC canonical function which can be used in T-SQL. There is no performance difference between any of these functions.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#3366ff;&quot;&gt;SELECT SYSDATETIME() AS &quot;SYSDATETIME&quot;,&lt;br /&gt;CURRENT_TIMESTAMP AS &quot;CURRENT_TIMESTAMP&quot;,&lt;br /&gt;GETDATE() AS &quot;GETDATE&quot;,&lt;br /&gt;{fn NOW()} AS &quot;fn_now()&quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5426684855403597954&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 53px; TEXT-ALIGN: center&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0s6Xzb3S5wJajy_JW-ifI-T60gYKEzdvI9GLxqfSZaPt-LkdJpvh7EGDgITRuFMXmK45aqYpGsNJ1NkrEU-1zbW23YBiyJKL4BRx9VRaGNYoWpNIAJMtYRrkrASf6apR9xqmKxL7b9mHo/s400/11.JPG&quot; border=&quot;0&quot; /&gt;</description><link>http://dotnetvj.blogspot.com/2010/01/get-current-date-and-time-in-sql-server.html</link><author>noreply@blogger.com (Vijaya Kadiyala)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0s6Xzb3S5wJajy_JW-ifI-T60gYKEzdvI9GLxqfSZaPt-LkdJpvh7EGDgITRuFMXmK45aqYpGsNJ1NkrEU-1zbW23YBiyJKL4BRx9VRaGNYoWpNIAJMtYRrkrASf6apR9xqmKxL7b9mHo/s72-c/11.JPG" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8456291897050186888.post-140341211229485313</guid><pubDate>Thu, 24 Dec 2009 17:56:00 +0000</pubDate><atom:updated>2009-12-24T12:59:29.417-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">DotNetVJ</category><category domain="http://www.blogger.com/atom/ns#">Joke</category><category domain="http://www.blogger.com/atom/ns#">SQL</category><category domain="http://www.blogger.com/atom/ns#">Vijaya Kadiyala</category><title>When you co-relate Disk Drives with Girls - Funny Joke</title><description>I got the below joke from my friend. Its very funny about co-relating Disk Drives with Girls.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;HARD-DISK woman: &lt;/strong&gt;She remembers everything, FOREVER.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;RAM woman: &lt;/strong&gt;She forgets about you, the moment you turn her off.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;INTERNET woman: &lt;/strong&gt;Difficult to access.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;SERVER woman: &lt;/strong&gt;Always busy when you need her.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;CD-ROM woman: &lt;/strong&gt;She is always faster and faster.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;EMAIL woman: &lt;/strong&gt;Every ten things she says, eight are nonsense.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;VIRUS woman: &lt;/strong&gt;Also called “wife”; when you are not expecting her, she comes, installs herself and uses all your resources. If you try to uninstall her you will lose something, if you don’t you will lose everything!!&lt;br /&gt;&lt;br /&gt;njoy..</description><link>http://dotnetvj.blogspot.com/2009/12/when-you-co-relate-disk-drives-with.html</link><author>noreply@blogger.com (Vijaya Kadiyala)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8456291897050186888.post-417280159107008419</guid><pubDate>Thu, 24 Dec 2009 17:24:00 +0000</pubDate><atom:updated>2009-12-24T12:42:58.589-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">DotNetVJ</category><category domain="http://www.blogger.com/atom/ns#">SQL Server</category><category domain="http://www.blogger.com/atom/ns#">Vijaya Kadiyala</category><title>Case Sensitive Search on a Case Insensitive SQL Server</title><description>In this post i would like to show you, how to implement case sensitive search on&lt;br /&gt;a case insensitive SQL Server column.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;First let me create a temp table:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#3333ff;&quot;&gt;--------------------------------&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#3333ff;&quot;&gt;create table #EMP&lt;br /&gt;(ID int, Name VARCHAR(30));&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#3333ff;&quot;&gt;Insert into #EMP&lt;br /&gt;Select 1, &#39;vijaya kadiyala&#39; UNION ALL&lt;br /&gt;Select 2, &#39;Vijaya Kadiyala&#39; UNION ALL&lt;br /&gt;Select 3, &#39;VIJAYA KADIYALA&#39;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now run the below query:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SELECT * FROM #EMP WHERE Name = &#39;VIJAYA KADIYALA&#39;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This query retrieves all the records as shown in below figure:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5418855646680419906&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 125px; TEXT-ALIGN: center&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMDqFuIFt31JbSepahZRMiOEr-jhyphenhyphenOlz3cp_Tbdp_punA_KYpMkU6H-jBn_qo7zW1s91OOFYtUlW6QXk6l3wYyl9oRuRSvNevH7bDXCuM9cy36qwW8fmRAKeYb8T69QnG9NeBrhIqfJl40/s400/rows.JPG&quot; border=&quot;0&quot; /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;The string literal what i passed to the query is in Upper case and i am expecting only the row which satisfies this condition. But by default SQL Server Collation attribute is Case insensitive. So SQL Server ignores the case of the string literal.&lt;/p&gt;&lt;p&gt;You can find the collation information by invoking the following procedure.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;SELECT DATABASEPROPERTYEX(&#39;AdventureWorks2008&#39;, &#39;Collation&#39;) &lt;/p&gt;&lt;p&gt;The default collation property value is SQL_Latin1_General_CP1_&lt;strong&gt;&lt;span style=&quot;color:#009900;&quot;&gt;CI&lt;/span&gt;&lt;/strong&gt;_AS. The text which is Highlighted in green color indicates Case Insensitive.&lt;/p&gt;&lt;p&gt;Now to convert the query into case sensitive query, just add collation property as shown below.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color:#3333ff;&quot;&gt;SELECT * FROM #EMP WHERE Name = &#39;VIJAYA KADIYALA&#39; COLLATE Latin1_General_CS_AS&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5418856720341071474&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 94px; TEXT-ALIGN: center&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYWtVJNQGNyKpaZG8hmKgM5DYZREfnhiLbqLHu6VcPf4r6NJqgg8BqmrM93-GQEH1Xtxh2bIkaBGoSFsbwOTixiMf-2GEkGo50TvLMFM9nfH1jABbvPCK-HBbQCkksbuoqUg-7XxTuOpl3/s400/rows.JPG&quot; border=&quot;0&quot; /&gt;Now the query is retruning only one row.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;</description><link>http://dotnetvj.blogspot.com/2009/12/case-sensitive-search-on-case.html</link><author>noreply@blogger.com (Vijaya Kadiyala)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMDqFuIFt31JbSepahZRMiOEr-jhyphenhyphenOlz3cp_Tbdp_punA_KYpMkU6H-jBn_qo7zW1s91OOFYtUlW6QXk6l3wYyl9oRuRSvNevH7bDXCuM9cy36qwW8fmRAKeYb8T69QnG9NeBrhIqfJl40/s72-c/rows.JPG" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8456291897050186888.post-4739201845459244232</guid><pubDate>Wed, 23 Dec 2009 17:59:00 +0000</pubDate><atom:updated>2009-12-23T14:13:10.376-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">DotNetVJ</category><category domain="http://www.blogger.com/atom/ns#">SQL</category><category domain="http://www.blogger.com/atom/ns#">Vijaya Kadiyala</category><title>Get Database Traffic Report in SQL Server</title><description>My Database team is working on, to find the database traffic on the server. The database is heavily used by the Online appllication and it is 24/7. We would like to see when the database is heavily loaded and see if there are any processes blocking each other which results in slower performance. One option which came to my mind is setting up a server side trace and capture &lt;strong&gt;rpc complete&lt;/strong&gt; and &lt;strong&gt;sql batch complete&lt;/strong&gt; events along with other events. So we decided to run the trace for 1 week during the first week of the month and 1 week during middle of the month and last week of the month because we are very sure that this is the time where the system is heavily loaded.&lt;br /&gt;&lt;br /&gt;During this preriod of time i happen to read one article from technet. With the help of this article you can find the follwwing information:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Determine who&#39;s connected to your SQL Server &lt;/li&gt;&lt;li&gt;Dealing with blocked processes &lt;/li&gt;&lt;li&gt;Performance killers &lt;/li&gt;&lt;li&gt;Clues to SQL Server performance problems&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://technet.microsoft.com/en-us/magazine/2005.05.systemtables.aspx&quot;&gt;Get A Traffic Report: Analyze Your Database Usage With System Tables&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;</description><link>http://dotnetvj.blogspot.com/2009/12/get-database-traffic-report-in-sql.html</link><author>noreply@blogger.com (Vijaya Kadiyala)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8456291897050186888.post-6291335573219286115</guid><pubDate>Wed, 23 Dec 2009 17:40:00 +0000</pubDate><atom:updated>2009-12-23T12:44:00.116-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">DotNetVJ</category><category domain="http://www.blogger.com/atom/ns#">SQL</category><category domain="http://www.blogger.com/atom/ns#">Vijaya Kadiyala</category><title>Why Upgrade to SQL Server 2008?</title><description>&lt;p&gt;With the release of the most recent version of SQL Server, Microsoft has delivered a Trusted, Productive and Intelligent Enterprise Data Platform. There are enhancements and new capabilities engineered into SQL Server 2008 to enable your applications to run better and reduce the amount of time you need to spend managing them. If you have been running existing applications on SQL Server 2000 or 2005, you will find a set of exciting new capabilities to improve your applications and reduce support needs within a familiar management interface. Many of these new features can provide immediate benefits without the need to make application changes.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Key reasons to upgrade to SQL Server 2008&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Experience the benefits right away&lt;/strong&gt; - Significant enhancements ranging from Data and Backup compression to query performance and enhanced database mirroring are available without the need to modify your existing applications.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Enhanced security and auditing&lt;/strong&gt; – Get data encryption and database auditing capabilities within existing applications.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Improved system management capabilities&lt;/strong&gt; - Features like policy based server management and new tools such as Performance Data Collection help you effectively manage the growth of your data.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;Performance Enhancements &lt;/strong&gt;– There have been many performance enhancements made throughout the technology stack, including enhancements within Analysis Services, Reporting Services and Integration Services. For example Unisys and Microsoft set a new ETL performance record by loading one terabyte of data in less than 30 minutes using SQL Server 2008 Integration Services. Read about additional &lt;a title=&quot;performance records&quot; href=&quot;http://www.microsoft.com/sqlserver/2008/en/us/benchmarks.aspx&quot;&gt;performance records&lt;/a&gt;.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Predictable System Response &lt;/strong&gt;– New Features such as query governor and data compression along with general scalability enhancements provide scalable solutions that are more reliable for very large enterprise systems.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;Developer productivity &lt;/strong&gt;- Tools like Entity Framework and LINQ, and new date/time, FILESTREAM and spatial datatypes provide powerful and easy to use application development enhancements.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;Enhanced Business Intelligence capabilities &lt;/strong&gt;– additional reporting capabilities integrated with Microsoft Office applications and a new report designer application allows the creation of enterprise reports without the need for Developer Studio.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Application Compatibility &amp;amp; ease of Migration &lt;/strong&gt;- There are upgrade tools available from Microsoft to help manage your upgrade from prior versions. Compatibility has been maintained with the majority of functionality which should enable most applications to upgrade seamlessly. Learn more about all the &lt;a title=&quot;system changes&quot; href=&quot;http://technet.microsoft.com/en-us/library/cc707787(SQL.100).aspx&quot;&gt;system changes&lt;/a&gt; from the prior version, and get started with infrastructure &lt;a title=&quot;assessment and planning&quot; href=&quot;http://technet.microsoft.com/en-us/solutionaccelerators/dd537572.aspx?ca=NOT&amp;amp;su=SQLSVR&amp;amp;sa=MAP&amp;amp;ct=WEBS&amp;amp;cn=MSCOMWEBS&amp;amp;au=BDM&amp;amp;go=MAPTN&amp;amp;dt=03252009&quot;&gt;assessment and planning&lt;/a&gt; for upgrade to SQL Server 2008.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Mainstream support – &lt;/strong&gt;With the latest version of SQL Server you can benefit from a long term and current support path. As of April 2008 SQL Server 2000 has moved off Mainstream support to an extended support path.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Consistent pricing and support – &lt;/strong&gt;Microsoft continues its pricing policies of SQL Server 2005 with some additional improvements. In addition, by participating in Microsoft’s &lt;a title=&quot;Software Assurance program&quot; href=&quot;http://www.microsoft.com/licensing/sa/default.mspx&quot;&gt;Software Assurance program&lt;/a&gt; you are eligible for product upgrades, support and other benefits.&lt;/p&gt;Referece : &lt;a href=&quot;http://www.microsoft.com/sqlserver/2008/en/us/why-upgrade.aspx&quot;&gt;http://www.microsoft.com/sqlserver/2008/en/us/why-upgrade.aspx&lt;/a&gt;</description><link>http://dotnetvj.blogspot.com/2009/12/why-upgrade-to-sql-server-2008.html</link><author>noreply@blogger.com (Vijaya Kadiyala)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8456291897050186888.post-980107519482739509</guid><pubDate>Tue, 22 Dec 2009 21:06:00 +0000</pubDate><atom:updated>2009-12-22T16:09:53.068-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ASP.NET</category><category domain="http://www.blogger.com/atom/ns#">DotNetVJ</category><category domain="http://www.blogger.com/atom/ns#">Vijaya Kadiyala</category><title>Print from the DataGrid view</title><description>I see one question in almost every technical forum. which is how to print the grid view data.&lt;br /&gt;&lt;br /&gt;The DataGridView control in .NET is an amazing data representation control, and contains many advanced features that we could benefit from.&lt;br /&gt;&lt;br /&gt;Please check out the below link which will give you very detailed information:&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/KB/printing/datagridviewprinter.aspx&quot;&gt;http://www.codeproject.com/KB/printing/datagridviewprinter.aspx&lt;/a&gt;</description><link>http://dotnetvj.blogspot.com/2009/12/print-from-datagrid-view.html</link><author>noreply@blogger.com (Vijaya Kadiyala)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8456291897050186888.post-5063662913113050614</guid><pubDate>Tue, 22 Dec 2009 20:56:00 +0000</pubDate><atom:updated>2009-12-22T16:04:41.860-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ASP.NET</category><category domain="http://www.blogger.com/atom/ns#">DotNetVJ</category><category domain="http://www.blogger.com/atom/ns#">Vijaya Kadiyala</category><title>Convert PDF to Image Using Ghostscript API</title><description>In this post i would like to reference one link to generate image from PDF using external APIs.&lt;br /&gt;&lt;br /&gt;You will need at least &lt;a href=&quot;http://downloads.sourceforge.net/ghostscript/gs864w32.exe?use_mirror=garr&quot;&gt;GhostScript 8.64&lt;/a&gt; (other versions have a problem with Vista). After you have installed the program, just copy the gs32dll.dll from the installation directory (the bin subdirectory) to the directory where you have the EXE of my program.&lt;br /&gt;&lt;br /&gt;Check out the below link for complete information:&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/KB/cs/GhostScriptUseWithCSharp.aspx&quot;&gt;http://www.codeproject.com/KB/cs/GhostScriptUseWithCSharp.aspx&lt;/a&gt;</description><link>http://dotnetvj.blogspot.com/2009/12/convert-pdf-to-image-using-ghostscript.html</link><author>noreply@blogger.com (Vijaya Kadiyala)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8456291897050186888.post-7834323050649215599</guid><pubDate>Tue, 22 Dec 2009 20:34:00 +0000</pubDate><atom:updated>2009-12-22T15:49:29.652-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">DotNetVJ</category><category domain="http://www.blogger.com/atom/ns#">SQL</category><category domain="http://www.blogger.com/atom/ns#">SQL Server</category><category domain="http://www.blogger.com/atom/ns#">Vijaya Kadiyala</category><title>Convert Rows to Columns with aggregate functions</title><description>&lt;div&gt;&lt;div&gt;In todays post i would like to show you a simple way to convert rows into columns with aggregate functions. You can also use PIVOT feature to do the same.&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;create table #Marks&lt;br /&gt;(ID int, Sub int, Value Int)&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Insert into #Marks&lt;br /&gt;Select 1, 1, 10 Union all&lt;br /&gt;Select 1, 2, 20 Union all&lt;br /&gt;Select 1, 3, 25 Union all&lt;br /&gt;Select 1, 4, 50 Union all&lt;br /&gt;Select 2, 1, 15 Union all&lt;br /&gt;Select 2, 2, 25 Union all&lt;br /&gt;Select 2, 3, 30 Union all&lt;br /&gt;Select 2, 4, 49&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Select * from #Marks;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5418164538235523202&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 154px; CURSOR: hand; HEIGHT: 199px; TEXT-ALIGN: center&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9E_GfAS7XKLY_p6jjsM3OV1bPCGz_xvBgP3h3D3_2YQ_RSo6yduyarWoSKIGUFnVTTiIjeLS86HN8PaTXGTBi9bkvnX1JeShtNF_Ce9vCQhe-5sij5C_ElOrLSKQb2DfzNvReNM-ycnvj/s400/rows.JPG&quot; border=&quot;0&quot; /&gt;&lt;br /&gt;SELECT Id,&lt;br /&gt;MAX(CASE WHEN Sub = 1 THEN Value ELSE &#39;&#39; END) AS Subject1,&lt;br /&gt;MAX(CASE WHEN Sub = 2 THEN Value ELSE &#39;&#39; END) AS Subject2,&lt;br /&gt;MAX(CASE WHEN Sub = 3 THEN Value ELSE &#39;&#39; END) AS Subject3,&lt;br /&gt;MAX(CASE WHEN Sub = 4 THEN Value ELSE &#39;&#39; END) AS Subject4&lt;br /&gt;FROM #Marks&lt;br /&gt;GROUP BY Id&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5418165129502389362&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 301px; CURSOR: hand; HEIGHT: 101px; TEXT-ALIGN: center&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTNFiN-CTXAUyrmDLxPV8nLpp_VE9vrpTr6ysu4rm-bgoCJP6vcWh_uDcG0kixaOvwM5Ujy9_AY9ZxpcU96m5akT62SgtXu_l1EBW0KuZqdduzmf9GVC8yx-d24ghPbVHudgaLnNiQ9reV/s400/rows.JPG&quot; border=&quot;0&quot; /&gt;&lt;br /&gt;&lt;div&gt;Thats it :)&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;Referece: &lt;a href=&quot;http://www.dotnetvj.com/&quot;&gt;www.DotNetVJ.com&lt;/a&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;/div&gt;</description><link>http://dotnetvj.blogspot.com/2009/12/convert-rows-to-columns-with-aggregate.html</link><author>noreply@blogger.com (Vijaya Kadiyala)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9E_GfAS7XKLY_p6jjsM3OV1bPCGz_xvBgP3h3D3_2YQ_RSo6yduyarWoSKIGUFnVTTiIjeLS86HN8PaTXGTBi9bkvnX1JeShtNF_Ce9vCQhe-5sij5C_ElOrLSKQb2DfzNvReNM-ycnvj/s72-c/rows.JPG" height="72" width="72"/><thr:total>0</thr:total></item></channel></rss>