<?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>My Technical Notes &#187; SQL server</title>
	<atom:link href="http://hariprasad.info/category/sql-server/feed/" rel="self" type="application/rss+xml" />
	<link>http://hariprasad.info</link>
	<description></description>
	<lastBuildDate>Fri, 16 Mar 2012 04:23:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	
<!-- Excerpts generated using Auto Excerpt plugin, http://mr.hokya.com/auto-excerpt/ -->
	<item>
		<title>Deleting large number of records from sql server 2005</title>
		<link>http://hariprasad.info/deleting-large-number-of-records-from-sql-server-2005/</link>
		<comments>http://hariprasad.info/deleting-large-number-of-records-from-sql-server-2005/#comments</comments>
		<pubDate>Thu, 17 Mar 2011 04:01:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[SQL server]]></category>
		<category><![CDATA[delete large records]]></category>

		<guid isPermaLink="false">http://hariprasad.info/?p=313</guid>
		<description><![CDATA[WHILE EXISTS ( SELECT * FROM table WHERE &#60;condition to delete&#62;)
BEGIN
  SET ROWCOUNT 1000
  DELETE Table WHERE &#60;Condition&#62;
  SET ROWCOUNT 0
ENd
&#160;
 <a href='http://hariprasad.info/deleting-large-number-of-records-from-sql-server-2005/'>Read More&#8230;</a>]]></description>
			<content:encoded><![CDATA[WHILE EXISTS ( SELECT * FROM table WHERE &lt;condition to delete&gt;)
BEGIN
  SET ROWCOUNT 1000
  DELETE Table WHERE &lt;Condition&gt;
  SET ROWCOUNT 0
ENd
&nbsp;
 <a href='http://hariprasad.info/deleting-large-number-of-records-from-sql-server-2005/'>Read More</a>]]></content:encoded>
			<wfw:commentRss>http://hariprasad.info/deleting-large-number-of-records-from-sql-server-2005/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	
<!-- Excerpts generated using Auto Excerpt plugin, http://mr.hokya.com/auto-excerpt/ -->
	<item>
		<title>SQL &#8211; Handling Null Values</title>
		<link>http://hariprasad.info/sql-handling-null-values/</link>
		<comments>http://hariprasad.info/sql-handling-null-values/#comments</comments>
		<pubDate>Fri, 07 Jan 2011 08:37:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[SQL server]]></category>
		<category><![CDATA[SQL server 2005]]></category>

		<guid isPermaLink="false">http://hariprasad.info/sql-handling-null-values/</guid>
		<description><![CDATA[1. A NULL value represents an UNKNOWN value
2. Under ANSI_NULLS ON, two NULL values will never be equal to each other because the two separate values are unknown. With ANSI_NULLS OFF, two separate NULL values will evaluate to equal values.
IF OBJECT_ID('SalesHistory')&#62;0 DROP TABLE SalesHistory;GOCREATE TABLE [dbo].[SalesHistory]( [SaleID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY, [Product] [varchar](10) NULL, [S <a href='http://hariprasad.info/sql-handling-null-values/'>Read More&#8230;</a>]]></description>
			<content:encoded><![CDATA[1. A NULL value represents an UNKNOWN value
2. Under ANSI_NULLS ON, two NULL values will never be equal to each other because the two separate values are unknown. With ANSI_NULLS OFF, two separate NULL values will evaluate to equal values.
IF OBJECT_ID('SalesHistory')&gt;0 DROP TABLE SalesHistory;GOCREATE TABLE [dbo].[SalesHistory]( [SaleID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY, [Product] [varchar](10) NULL, [S <a href='http://hariprasad.info/sql-handling-null-values/'>Read More</a>]]></content:encoded>
			<wfw:commentRss>http://hariprasad.info/sql-handling-null-values/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	
<!-- Excerpts generated using Auto Excerpt plugin, http://mr.hokya.com/auto-excerpt/ -->
	<item>
		<title>SQL &#8211; Execute T-SQL batch multiple times</title>
		<link>http://hariprasad.info/sql-execute-t-sql-batch-multiple-times/</link>
		<comments>http://hariprasad.info/sql-execute-t-sql-batch-multiple-times/#comments</comments>
		<pubDate>Fri, 07 Jan 2011 08:34:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[SQL server]]></category>
		<category><![CDATA[multiple times]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://hariprasad.info/sql-execute-t-sql-batch-multiple-times/</guid>
		<description><![CDATA[Executing T-Sql batch multiple times.




Description:
If we want to execute T-sql command multiple times
2000:
CREATE TABLE dbo.TEST (ID INT IDENTITY (1,1), ROWID unique identifier) CREATE TABLE dbo.TEST2 (ID INT IDENTITY (1,1), ROWID unique identifier) GO DECLARE @counter INT&#160; SET @counter = 0&#160; WHILE @counter &#60; 1000&#160; BEGIN &#160;&#160;&#160;&#160;&#160;&#160; INSERT INTO dbo.TEST (ROWID) VAL <a href='http://hariprasad.info/sql-execute-t-sql-batch-multiple-times/'>Read More&#8230;</a>]]></description>
			<content:encoded><![CDATA[



Executing T-Sql batch multiple times.




Description:
If we want to execute T-sql command multiple times
2000:
CREATE TABLE dbo.TEST (ID INT IDENTITY (1,1), ROWID unique identifier) CREATE TABLE dbo.TEST2 (ID INT IDENTITY (1,1), ROWID unique identifier) GO DECLARE @counter INT&nbsp; SET @counter = 0&nbsp; WHILE @counter &lt; 1000&nbsp; BEGIN &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; INSERT INTO dbo.TEST (ROWID) VAL <a href='http://hariprasad.info/sql-execute-t-sql-batch-multiple-times/'>Read More</a>]]></content:encoded>
			<wfw:commentRss>http://hariprasad.info/sql-execute-t-sql-batch-multiple-times/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	
<!-- Excerpts generated using Auto Excerpt plugin, http://mr.hokya.com/auto-excerpt/ -->
	<item>
		<title>SQL &#8211; Delete duplicate row without primary key</title>
		<link>http://hariprasad.info/sql-delete-duplicate-row-without-primary-key/</link>
		<comments>http://hariprasad.info/sql-delete-duplicate-row-without-primary-key/#comments</comments>
		<pubDate>Fri, 07 Jan 2011 08:32:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[SQL server]]></category>
		<category><![CDATA[duplicate row]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://hariprasad.info/sql-delete-duplicate-row-without-primary-key/</guid>
		<description><![CDATA[Deleting a duplicate row without primary key.




Scenario:




ID


FirstName


LastName




1


Bob


Smith




2


Dave


Jones




3


Karen


White




1


Bob


Smith




1


Bob


Smith




2000:
â€˜filters to no. of rows to process, here it allows to take only I record
set ROWCOUNT 2
â€˜so here it scans only 2 records from the available 3 records and deletes those 2 records
delete from customers2 where  <a href='http://hariprasad.info/sql-delete-duplicate-row-without-primary-key/'>Read More&#8230;</a>]]></description>
			<content:encoded><![CDATA[



Deleting a duplicate row without primary key.




Scenario:




ID


FirstName


LastName




1


Bob


Smith




2


Dave


Jones




3


Karen


White




1


Bob


Smith




1


Bob


Smith




2000:
â€˜filters to no. of rows to process, here it allows to take only I record
set ROWCOUNT 2
â€˜so here it scans only 2 records from the available 3 records and deletes those 2 records
delete from customers2 where  <a href='http://hariprasad.info/sql-delete-duplicate-row-without-primary-key/'>Read More</a>]]></content:encoded>
			<wfw:commentRss>http://hariprasad.info/sql-delete-duplicate-row-without-primary-key/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	
<!-- Excerpts generated using Auto Excerpt plugin, http://mr.hokya.com/auto-excerpt/ -->
	<item>
		<title>SQL &#8211; Truncate vs Delete</title>
		<link>http://hariprasad.info/sql-truncate-vs-delete/</link>
		<comments>http://hariprasad.info/sql-truncate-vs-delete/#comments</comments>
		<pubDate>Fri, 07 Jan 2011 08:31:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[SQL server]]></category>
		<category><![CDATA[truncate vs delete]]></category>

		<guid isPermaLink="false">http://hariprasad.info/sql-truncate-vs-delete/</guid>
		<description><![CDATA[Difference between truncate and Delete (deleting records)




Truncate


Delete




Deletes all the records by deallocating the pages which reduces the resource overhead of logging the deletion and no. of lock acquired. Only one record is entered in the transaction log that is the deallocation of page.


Deletes one row at a time which is entered in the transaction log as LSN(Log sequence no.).




Records remo <a href='http://hariprasad.info/sql-truncate-vs-delete/'>Read More&#8230;</a>]]></description>
			<content:encoded><![CDATA[



Difference between truncate and Delete (deleting records)




Truncate


Delete




Deletes all the records by deallocating the pages which reduces the resource overhead of logging the deletion and no. of lock acquired. Only one record is entered in the transaction log that is the deallocation of page.


Deletes one row at a time which is entered in the transaction log as LSN(Log sequence no.).




Records remo <a href='http://hariprasad.info/sql-truncate-vs-delete/'>Read More</a>]]></content:encoded>
			<wfw:commentRss>http://hariprasad.info/sql-truncate-vs-delete/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	
<!-- Excerpts generated using Auto Excerpt plugin, http://mr.hokya.com/auto-excerpt/ -->
	<item>
		<title>SQL Server Date formats</title>
		<link>http://hariprasad.info/sql-server-date-formats/</link>
		<comments>http://hariprasad.info/sql-server-date-formats/#comments</comments>
		<pubDate>Thu, 06 Jan 2011 15:19:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[SQL server]]></category>
		<category><![CDATA[date formats]]></category>

		<guid isPermaLink="false">http://hariprasad.info/?p=284</guid>
		<description><![CDATA[Date formats in   sql server






DATE FORMATS


Format     #
Query (current date:     12/30/2006)
Sample


1
select     convert(varchar, getdate(), 1)
12/30/06


2
select     convert(varchar, getdate(), 2)
06.12.30


3
select     convert(varchar, getdate(), 3)
30/12/06


4
select     convert(varchar, getdate(), 4)
30.12.06


5
select     convert(varchar, getdate(), 5)
30-12-06


6
select     convert(varchar,  <a href='http://hariprasad.info/sql-server-date-formats/'>Read More&#8230;</a>]]></description>
			<content:encoded><![CDATA[


 Date formats in   sql server






DATE FORMATS


Format     #
Query (current date:     12/30/2006)
Sample


1
select     convert(varchar, getdate(), 1)
12/30/06


2
select     convert(varchar, getdate(), 2)
06.12.30


3
select     convert(varchar, getdate(), 3)
30/12/06


4
select     convert(varchar, getdate(), 4)
30.12.06


5
select     convert(varchar, getdate(), 5)
30-12-06


6
select     convert(varchar,  <a href='http://hariprasad.info/sql-server-date-formats/'>Read More</a>]]></content:encoded>
			<wfw:commentRss>http://hariprasad.info/sql-server-date-formats/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	
<!-- Excerpts generated using Auto Excerpt plugin, http://mr.hokya.com/auto-excerpt/ -->
	<item>
		<title>SQL server and code names</title>
		<link>http://hariprasad.info/sql-server-and-code-names/</link>
		<comments>http://hariprasad.info/sql-server-and-code-names/#comments</comments>
		<pubDate>Wed, 10 Nov 2010 09:01:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[SQL server]]></category>

		<guid isPermaLink="false">http://hariprasad.info/?p=198</guid>
		<description><![CDATA[&#8230;]]></description>
			<content:encoded><![CDATA[In 1988, Microsoft released its first  version of SQL Server. It was developed jointly by Microsoft  and Sybase  for the OS/2 platform.

1993 â€“ SQL Server 4.21 for Windows NT
1995 â€“ SQL Server 6.0, codenamed SQL95
1996 â€“ SQL Server 6.5, codenamed Hydra
1999 â€“ SQL Server 7.0, codenamed Sphinx
1999 â€“ SQL Server 7.0 OLAP, codenamed Plato
2000 â€“ SQL Server 2000 32-bit, codenamed Shiloh (version 8.0)
2003 â€ <a href='http://hariprasad.info/sql-server-and-code-names/'>Read More</a>]]></content:encoded>
			<wfw:commentRss>http://hariprasad.info/sql-server-and-code-names/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	
<!-- Excerpts generated using Auto Excerpt plugin, http://mr.hokya.com/auto-excerpt/ -->
	<item>
		<title>Recover MySQL Root Password</title>
		<link>http://hariprasad.info/recover-mysql-root-password/</link>
		<comments>http://hariprasad.info/recover-mysql-root-password/#comments</comments>
		<pubDate>Sun, 31 Oct 2010 17:02:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[SQL server]]></category>

		<guid isPermaLink="false">http://hariprasad.info/?p=87</guid>
		<description><![CDATA[To recover MySQL root password:
http://www.cyberciti.biz/tips/recover-mysql-root-password.html
 <a href='http://hariprasad.info/recover-mysql-root-password/'>Read More&#8230;</a>]]></description>
			<content:encoded><![CDATA[To recover MySQL root password:
http://www.cyberciti.biz/tips/recover-mysql-root-password.html
 <a href='http://hariprasad.info/recover-mysql-root-password/'>Read More</a>]]></content:encoded>
			<wfw:commentRss>http://hariprasad.info/recover-mysql-root-password/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	
<!-- Excerpts generated using Auto Excerpt plugin, http://mr.hokya.com/auto-excerpt/ -->
	<item>
		<title>sql management studio &#8211; using non standard port</title>
		<link>http://hariprasad.info/sql-management-studio-using-non-standard-port/</link>
		<comments>http://hariprasad.info/sql-management-studio-using-non-standard-port/#comments</comments>
		<pubDate>Sun, 31 Oct 2010 12:44:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[SQL server]]></category>
		<category><![CDATA[non standard port]]></category>
		<category><![CDATA[sql management studio]]></category>

		<guid isPermaLink="false">http://hariprasad.info/?p=183</guid>
		<description><![CDATA[To connect sql management studio to any sql server using non defualt port, we have to use &#8220;,&#8221; beside the server IP (or host name).
For e.g., server: 1.1.1.1 and port 1234 we specify it as
1.1.1.,1234
 <a href='http://hariprasad.info/sql-management-studio-using-non-standard-port/'>Read More&#8230;</a>]]></description>
			<content:encoded><![CDATA[To connect sql management studio to any sql server using non defualt port, we have to use &#8220;,&#8221; beside the server IP (or host name).
For e.g., server: 1.1.1.1 and port 1234 we specify it as
1.1.1.,1234
 <a href='http://hariprasad.info/sql-management-studio-using-non-standard-port/'>Read More</a>]]></content:encoded>
			<wfw:commentRss>http://hariprasad.info/sql-management-studio-using-non-standard-port/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	
<!-- Excerpts generated using Auto Excerpt plugin, http://mr.hokya.com/auto-excerpt/ -->
	<item>
		<title>Find Largest table by Row count &#8211; SQL server 2005</title>
		<link>http://hariprasad.info/find-largest-table-by-row-count-sql-server-2005/</link>
		<comments>http://hariprasad.info/find-largest-table-by-row-count-sql-server-2005/#comments</comments>
		<pubDate>Mon, 31 May 2010 04:54:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[SQL server]]></category>

		<guid isPermaLink="false">http://hariprasad.info/find-largest-table-by-row-count-sql-server-2005/</guid>
		<description><![CDATA[USE AdventureWorks

GO
SELECT OBJECT_NAME(OBJECT_ID) TableName, st.row_count
FROM sys.dm_db_partition_stats st
WHERE index_id &#60; 2
ORDER BY st.row_count DESC
GO


 <a href='http://hariprasad.info/find-largest-table-by-row-count-sql-server-2005/'>Read More&#8230;</a>]]></description>
			<content:encoded><![CDATA[ 
USE AdventureWorks

GO
SELECT OBJECT_NAME(OBJECT_ID) TableName, st.row_count
FROM sys.dm_db_partition_stats st
WHERE index_id &lt; 2
ORDER BY st.row_count DESC
GO


 <a href='http://hariprasad.info/find-largest-table-by-row-count-sql-server-2005/'>Read More</a>]]></content:encoded>
			<wfw:commentRss>http://hariprasad.info/find-largest-table-by-row-count-sql-server-2005/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

