<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SQL-Query | Varinder Sandhu</title>
	<atom:link href="https://varindersandhu.in/category/sql/sql-query/feed/" rel="self" type="application/rss+xml" />
	<link>https://varindersandhu.in</link>
	<description>Keep it Simple and Smart</description>
	<lastBuildDate>Wed, 29 Aug 2018 05:27:24 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.3</generator>

<image>
	<url>https://varindersandhu.in/wp-content/uploads/2020/05/varindersandhu_favicon.ico</url>
	<title>SQL-Query | Varinder Sandhu</title>
	<link>https://varindersandhu.in</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">22788835</site>	<item>
		<title>SQL Server &#8211; How to read the SQL Server Error log files using TSQL</title>
		<link>https://varindersandhu.in/2014/11/11/sql-server-how-to-read-the-sql-server-error-log-files-using-tsql/</link>
		
		<dc:creator><![CDATA[Varinder Sandhu]]></dc:creator>
		<pubDate>Tue, 11 Nov 2014 10:04:51 +0000</pubDate>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL-Advanced]]></category>
		<category><![CDATA[SQL-Query]]></category>
		<category><![CDATA[SQL-Scripts]]></category>
		<category><![CDATA[SQL-Tips and Tricks]]></category>
		<category><![CDATA[Varinder Sandhu]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server Agent Error]]></category>
		<category><![CDATA[SQL Server Error Log]]></category>
		<category><![CDATA[SQL Server Log Files]]></category>
		<guid isPermaLink="false">http://www.varindersandhu.in/?p=3563</guid>

					<description><![CDATA[<p>There is undocumented system stored procedure sp_readerrorlog which allows us to read the SQL Server error log files directly using T-SQL. This procedure has total 7 parameters as given below: Parameter Values First Parameter Value of error log file you want to read: 0 = current, 1 = Archive #1,</p>
<p>The post <a href="https://varindersandhu.in/2014/11/11/sql-server-how-to-read-the-sql-server-error-log-files-using-tsql/">SQL Server – How to read the SQL Server Error log files using TSQL</a> first appeared on <a href="https://varindersandhu.in">Varinder Sandhu</a>.</p>]]></description>
		
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3563</post-id>	</item>
		<item>
		<title>SQL Server – How Like operator work with datetime</title>
		<link>https://varindersandhu.in/2013/02/12/sql-server-how-like-operator-work-with-datetime/</link>
		
		<dc:creator><![CDATA[Varinder Sandhu]]></dc:creator>
		<pubDate>Tue, 12 Feb 2013 17:25:11 +0000</pubDate>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL-General]]></category>
		<category><![CDATA[SQL-Query]]></category>
		<category><![CDATA[SQL-Scripts]]></category>
		<category><![CDATA[SQL-Tips and Tricks]]></category>
		<category><![CDATA[Varinder Sandhu]]></category>
		<category><![CDATA[DateTime]]></category>
		<category><![CDATA[Like Operator]]></category>
		<category><![CDATA[SQL Server]]></category>
		<guid isPermaLink="false">http://www.varindersandhu.in/?p=2754</guid>

					<description><![CDATA[<p>Today, my one of the friend shared a very interesting fact about like operator. With the help of this post I am sharing with you all. We need to convert it to character data while comparing with the like operator. Let‘s check with example Like operator with datetime Like Operator</p>
<p>The post <a href="https://varindersandhu.in/2013/02/12/sql-server-how-like-operator-work-with-datetime/">SQL Server – How Like operator work with datetime</a> first appeared on <a href="https://varindersandhu.in">Varinder Sandhu</a>.</p>]]></description>
		
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2754</post-id>	</item>
		<item>
		<title>SQL Server &#8211; How to add column dynamically in where clause</title>
		<link>https://varindersandhu.in/2012/12/04/sql-server-how-to-add-column-dynamically-in-where-clause/</link>
		
		<dc:creator><![CDATA[Varinder Sandhu]]></dc:creator>
		<pubDate>Tue, 04 Dec 2012 14:44:11 +0000</pubDate>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL-Advanced]]></category>
		<category><![CDATA[SQL-General]]></category>
		<category><![CDATA[SQL-Query]]></category>
		<category><![CDATA[SQL-Scripts]]></category>
		<category><![CDATA[SQL-Tips and Tricks]]></category>
		<category><![CDATA[Varinder Sandhu]]></category>
		<category><![CDATA[add column dynamically]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[where clause]]></category>
		<guid isPermaLink="false">http://www.varindersandhu.in/?p=2672</guid>

					<description><![CDATA[<p>In this post, we will learn with example how to add the column dynamically in where clause. Example: For demo we have table as shown in the snapshot Basically we want to execute following script (i.e. Script: 1) but column name (i.e. FIRST_NAME) added dynamically in where clause. Script: 1</p>
<p>The post <a href="https://varindersandhu.in/2012/12/04/sql-server-how-to-add-column-dynamically-in-where-clause/">SQL Server – How to add column dynamically in where clause</a> first appeared on <a href="https://varindersandhu.in">Varinder Sandhu</a>.</p>]]></description>
		
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2672</post-id>	</item>
		<item>
		<title>SQL Server &#8211; The multi-part identifier could not be bound State &#8211; Msg 4104 &#8211; Fix</title>
		<link>https://varindersandhu.in/2012/11/23/sql-server-the-multi-part-identifier-could-not-be-bound-state-msg-4104-fix/</link>
					<comments>https://varindersandhu.in/2012/11/23/sql-server-the-multi-part-identifier-could-not-be-bound-state-msg-4104-fix/#comments</comments>
		
		<dc:creator><![CDATA[Varinder Sandhu]]></dc:creator>
		<pubDate>Fri, 23 Nov 2012 10:28:43 +0000</pubDate>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL-Advanced]]></category>
		<category><![CDATA[SQL-General]]></category>
		<category><![CDATA[SQL-Query]]></category>
		<category><![CDATA[SQL-Scripts]]></category>
		<category><![CDATA[SQL-Tips and Tricks]]></category>
		<category><![CDATA[Varinder Sandhu]]></category>
		<category><![CDATA[Msg 4104]]></category>
		<category><![CDATA[multi-part identifier]]></category>
		<category><![CDATA[SQL Server]]></category>
		<guid isPermaLink="false">http://www.varindersandhu.in/?p=2664</guid>

					<description><![CDATA[<p>Error Msg Server: Msg 4104, Level 16, State 1, Line 1 The multi-part identifier could not be bound. Cause of this Error Msg: Case: 1 This error usually occurs when an alias is used when referencing a column in a SELECT statement and the alias used is not defined anywhere</p>
<p>The post <a href="https://varindersandhu.in/2012/11/23/sql-server-the-multi-part-identifier-could-not-be-bound-state-msg-4104-fix/">SQL Server – The multi-part identifier could not be bound State – Msg 4104 – Fix</a> first appeared on <a href="https://varindersandhu.in">Varinder Sandhu</a>.</p>]]></description>
		
					<wfw:commentRss>https://varindersandhu.in/2012/11/23/sql-server-the-multi-part-identifier-could-not-be-bound-state-msg-4104-fix/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2664</post-id>	</item>
		<item>
		<title>SQL Server &#8211; Generate Row Number in Select and Select into</title>
		<link>https://varindersandhu.in/2012/08/30/sql-server-generate-row-number-in-select-and-select-into/</link>
		
		<dc:creator><![CDATA[Varinder Sandhu]]></dc:creator>
		<pubDate>Thu, 30 Aug 2012 11:24:40 +0000</pubDate>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL-Advanced]]></category>
		<category><![CDATA[SQL-General]]></category>
		<category><![CDATA[SQL-Query]]></category>
		<category><![CDATA[SQL-Scripts]]></category>
		<category><![CDATA[SQL-Tips and Tricks]]></category>
		<category><![CDATA[Varinder Sandhu]]></category>
		<category><![CDATA[Row Number]]></category>
		<category><![CDATA[Select into]]></category>
		<category><![CDATA[SQL Server]]></category>
		<guid isPermaLink="false">http://www.varindersandhu.in/?p=2555</guid>

					<description><![CDATA[<p>How to Generate the Row Number in Select and Select into script? Using IDENTITY for Select Into SELECT RowNumber=IDENTITY(int,1,1),FIRST_NAME,LAST_NAME into EMPLOYEE_backup FROM EMPLOYEE Using Row_Number() for Select SELECT ROW_NUMBER() OVER (ORDER BY ID ASC) RowNumber, FIRST_NAME,LAST_NAME FROM EMPLOYEE Using Row_Number() for Select into SELECT ROW_NUMBER() OVER (ORDER BY ID ASC)</p>
<p>The post <a href="https://varindersandhu.in/2012/08/30/sql-server-generate-row-number-in-select-and-select-into/">SQL Server – Generate Row Number in Select and Select into</a> first appeared on <a href="https://varindersandhu.in">Varinder Sandhu</a>.</p>]]></description>
		
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2555</post-id>	</item>
		<item>
		<title>SQL Server &#8211; Error 3154: The backup set holds a backup of a database other than the existing database</title>
		<link>https://varindersandhu.in/2012/03/08/sql-server-error-3154-the-backup-set-holds-a-backup-of-a-database-other-than-the-existing-database/</link>
					<comments>https://varindersandhu.in/2012/03/08/sql-server-error-3154-the-backup-set-holds-a-backup-of-a-database-other-than-the-existing-database/#comments</comments>
		
		<dc:creator><![CDATA[Varinder Sandhu]]></dc:creator>
		<pubDate>Thu, 08 Mar 2012 17:51:51 +0000</pubDate>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL-Backup & Restore]]></category>
		<category><![CDATA[SQL-Query]]></category>
		<category><![CDATA[SQL-Scripts]]></category>
		<category><![CDATA[SQL-Tips and Tricks]]></category>
		<category><![CDATA[Varinder Sandhu]]></category>
		<category><![CDATA[Error 3154]]></category>
		<category><![CDATA[Restore Database]]></category>
		<category><![CDATA[SQL Server]]></category>
		<guid isPermaLink="false">http://www.varindersandhu.in/?p=2254</guid>

					<description><![CDATA[<p>Sometime we faced the following error message while restoring the database Error 3154: The backup set holds a backup of a database other than the existing database. Solution: Use WITH REPLACE while using the restore script as Script 1 RESTORE DATABASE YourDB FROM DISK = &#039;C:\YourDB.bak&#039; WITH REPLACE  Script 2</p>
<p>The post <a href="https://varindersandhu.in/2012/03/08/sql-server-error-3154-the-backup-set-holds-a-backup-of-a-database-other-than-the-existing-database/">SQL Server – Error 3154: The backup set holds a backup of a database other than the existing database</a> first appeared on <a href="https://varindersandhu.in">Varinder Sandhu</a>.</p>]]></description>
		
					<wfw:commentRss>https://varindersandhu.in/2012/03/08/sql-server-error-3154-the-backup-set-holds-a-backup-of-a-database-other-than-the-existing-database/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2254</post-id>	</item>
		<item>
		<title>SQL Server &#8211; User Defined Group</title>
		<link>https://varindersandhu.in/2011/10/25/sql-server-user-defined-group/</link>
		
		<dc:creator><![CDATA[Varinder Sandhu]]></dc:creator>
		<pubDate>Tue, 25 Oct 2011 12:25:46 +0000</pubDate>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL-Advanced]]></category>
		<category><![CDATA[SQL-General]]></category>
		<category><![CDATA[SQL-Query]]></category>
		<category><![CDATA[SQL-Scripts]]></category>
		<category><![CDATA[SQL-Tips and Tricks]]></category>
		<category><![CDATA[Varinder Sandhu]]></category>
		<category><![CDATA[Custom Group]]></category>
		<category><![CDATA[SQL Script]]></category>
		<category><![CDATA[SQL Server]]></category>
		<guid isPermaLink="false">http://www.varindersandhu.in/?p=1838</guid>

					<description><![CDATA[<p>I had requirement to make the User Defined Group in Reports (i.e. Crystal Reports) Example: CREATE TABLE test_custom_group ( id INT, dept VARCHAR(20), detail VARCHAR(30), salary NUMERIC(5,2) ) Created a Function CREATE FUNCTION test_fn ( ) RETURNS @temp_table TABLE ( sno int, dept varchar(20), grp varchar(10) ) AS BEGIN INSERT</p>
<p>The post <a href="https://varindersandhu.in/2011/10/25/sql-server-user-defined-group/">SQL Server – User Defined Group</a> first appeared on <a href="https://varindersandhu.in">Varinder Sandhu</a>.</p>]]></description>
		
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1838</post-id>	</item>
		<item>
		<title>SQL Server – User Defined Sort Order</title>
		<link>https://varindersandhu.in/2011/10/24/sql-server-user-defined-sort-order/</link>
		
		<dc:creator><![CDATA[Varinder Sandhu]]></dc:creator>
		<pubDate>Mon, 24 Oct 2011 12:49:11 +0000</pubDate>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL-Advanced]]></category>
		<category><![CDATA[SQL-General]]></category>
		<category><![CDATA[SQL-Query]]></category>
		<category><![CDATA[SQL-Scripts]]></category>
		<category><![CDATA[SQL-Tips and Tricks]]></category>
		<category><![CDATA[Varinder Sandhu]]></category>
		<category><![CDATA[Custom Sort Order]]></category>
		<category><![CDATA[Sort Order]]></category>
		<category><![CDATA[SQL Script]]></category>
		<category><![CDATA[SQL Server]]></category>
		<guid isPermaLink="false">http://www.varindersandhu.in/?p=1814</guid>

					<description><![CDATA[<p>I had requirement to get the values with Use Defined Sort order. Here is simple way to get User Defined Sort order Example: Created a table as : CREATE TABLE sort_order ( id INT, dept VARCHAR(20), detail VARCHAR(30) ) Inserted few rows in table as Requirement: Now we want to</p>
<p>The post <a href="https://varindersandhu.in/2011/10/24/sql-server-user-defined-sort-order/">SQL Server – User Defined Sort Order</a> first appeared on <a href="https://varindersandhu.in">Varinder Sandhu</a>.</p>]]></description>
		
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1814</post-id>	</item>
		<item>
		<title>SQL Server &#8211; sp_MSforeachdb &#8211; Undocumented Stored Procedure</title>
		<link>https://varindersandhu.in/2011/10/16/sql-server-sp_msforeachdb-undocumented-stored-procedure/</link>
		
		<dc:creator><![CDATA[Varinder Sandhu]]></dc:creator>
		<pubDate>Sun, 16 Oct 2011 04:56:34 +0000</pubDate>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL-Advanced]]></category>
		<category><![CDATA[SQL-Query]]></category>
		<category><![CDATA[SQL-Scripts]]></category>
		<category><![CDATA[SQL-Tips and Tricks]]></category>
		<category><![CDATA[Varinder Sandhu]]></category>
		<category><![CDATA[sp_MSforeachdb]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<guid isPermaLink="false">http://www.varindersandhu.in/?p=1784</guid>

					<description><![CDATA[<p>The undocumented stored procedure &#8220;sp_MSforeachdb&#8221; is found in the &#8220;master&#8221; database. This is similar to sp_MSforeachtable. This stored procedure Sp_MSforeachdb gives a DBA the ability to cycle through every database in your catalog. This stored procedure will loop every database in your catalog for performing a command. This stored procedure</p>
<p>The post <a href="https://varindersandhu.in/2011/10/16/sql-server-sp_msforeachdb-undocumented-stored-procedure/">SQL Server – sp_MSforeachdb – Undocumented Stored Procedure</a> first appeared on <a href="https://varindersandhu.in">Varinder Sandhu</a>.</p>]]></description>
		
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1784</post-id>	</item>
		<item>
		<title>SQL Server &#8211; sp_MSforeachtable &#8211; Undocumented Stored Procedure</title>
		<link>https://varindersandhu.in/2011/10/16/sql-server-sp_msforeachtable-undocumented-stored-procedure/</link>
					<comments>https://varindersandhu.in/2011/10/16/sql-server-sp_msforeachtable-undocumented-stored-procedure/#comments</comments>
		
		<dc:creator><![CDATA[Varinder Sandhu]]></dc:creator>
		<pubDate>Sat, 15 Oct 2011 19:13:36 +0000</pubDate>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL-Advanced]]></category>
		<category><![CDATA[SQL-Query]]></category>
		<category><![CDATA[SQL-Scripts]]></category>
		<category><![CDATA[SQL-Tips and Tricks]]></category>
		<category><![CDATA[Varinder Sandhu]]></category>
		<category><![CDATA[sp_MSforeachtable]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<guid isPermaLink="false">http://www.varindersandhu.in/?p=1772</guid>

					<description><![CDATA[<p>As database administrators or developers, sometimes we need to perform an action on all of the tables within a database. For example, we may want to disable check constraints for all tables prior to loading a bunch of data. No doubt we can use the dynamic statement or cursor for</p>
<p>The post <a href="https://varindersandhu.in/2011/10/16/sql-server-sp_msforeachtable-undocumented-stored-procedure/">SQL Server – sp_MSforeachtable – Undocumented Stored Procedure</a> first appeared on <a href="https://varindersandhu.in">Varinder Sandhu</a>.</p>]]></description>
		
					<wfw:commentRss>https://varindersandhu.in/2011/10/16/sql-server-sp_msforeachtable-undocumented-stored-procedure/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1772</post-id>	</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/

Page Caching using Disk: Enhanced 
Database Caching using Disk

Served from: varindersandhu.in @ 2025-10-30 13:51:53 by W3 Total Cache
-->