<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SQL SERVER &#8211; How to Rename a Column Name or Table Name</title>
	<atom:link href="http://blog.sqlauthority.com/2008/08/26/sql-server-how-to-rename-a-column-name-or-table-name/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2008/08/26/sql-server-how-to-rename-a-column-name-or-table-name/</link>
	<description>Notes of a SQL Server MVP and Database Administrator</description>
	<lastBuildDate>Sat, 21 Nov 2009 05:54:09 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Sunil Sharma</title>
		<link>http://blog.sqlauthority.com/2008/08/26/sql-server-how-to-rename-a-column-name-or-table-name/#comment-57548</link>
		<dc:creator>Sunil Sharma</dc:creator>
		<pubDate>Thu, 12 Nov 2009 12:57:15 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=888#comment-57548</guid>
		<description>thank u..........</description>
		<content:encoded><![CDATA[<p>thank u&#8230;&#8230;&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rick M.</title>
		<link>http://blog.sqlauthority.com/2008/08/26/sql-server-how-to-rename-a-column-name-or-table-name/#comment-57309</link>
		<dc:creator>Rick M.</dc:creator>
		<pubDate>Wed, 04 Nov 2009 00:13:26 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=888#comment-57309</guid>
		<description>Thanks pinaldave for a great blog!  So much useful information you&#039;ve gained through hard experience you share with us all!

Here&#039;s a note I would like to add to this article.  Do not use square brackets in your target column name or it will put them in there literally! For example:

sp_rename &#039;[my table].[my col]&#039;, &#039;[my col2]&#039;, &#039;COLUMN&#039;

is WRONG!  Instead say:

sp_rename &#039;[my table].[my col]&#039;, &#039;my col2&#039;, &#039;COLUMN&#039;

And what to do if you have columns with brackets that need renaming?  You have to use 2 brackets up front and 3 brackets behind!!

sp_rename &#039;[my table].[[my col2]]]&#039;, &#039;my col2&#039;, &#039;COLUMN&#039;

Another thing, I figured out this syntax by trial and error (on SQL Server 2008.)  It also is needed when doing an aggregate on a column with brackets in its name:

select SUM([[my col2]]])</description>
		<content:encoded><![CDATA[<p>Thanks pinaldave for a great blog!  So much useful information you&#8217;ve gained through hard experience you share with us all!</p>
<p>Here&#8217;s a note I would like to add to this article.  Do not use square brackets in your target column name or it will put them in there literally! For example:</p>
<p>sp_rename &#8216;[my table].[my col]&#8216;, &#8216;[my col2]&#8216;, &#8216;COLUMN&#8217;</p>
<p>is WRONG!  Instead say:</p>
<p>sp_rename &#8216;[my table].[my col]&#8216;, &#8216;my col2&#8242;, &#8216;COLUMN&#8217;</p>
<p>And what to do if you have columns with brackets that need renaming?  You have to use 2 brackets up front and 3 brackets behind!!</p>
<p>sp_rename &#8216;[my table].[[my col2]]]&#8217;, &#8216;my col2&#8242;, &#8216;COLUMN&#8217;</p>
<p>Another thing, I figured out this syntax by trial and error (on SQL Server 2008.)  It also is needed when doing an aggregate on a column with brackets in its name:</p>
<p>select SUM([[my col2]]])</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: khaled khelawy</title>
		<link>http://blog.sqlauthority.com/2008/08/26/sql-server-how-to-rename-a-column-name-or-table-name/#comment-57096</link>
		<dc:creator>khaled khelawy</dc:creator>
		<pubDate>Wed, 28 Oct 2009 07:55:05 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=888#comment-57096</guid>
		<description>thx sir</description>
		<content:encoded><![CDATA[<p>thx sir</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eloise</title>
		<link>http://blog.sqlauthority.com/2008/08/26/sql-server-how-to-rename-a-column-name-or-table-name/#comment-56451</link>
		<dc:creator>Eloise</dc:creator>
		<pubDate>Mon, 05 Oct 2009 23:21:57 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=888#comment-56451</guid>
		<description>This is a great find, but it&#039;s not exactly what I need.

We&#039;re looking at upgrading our servers from 2005 to 2008.  This will also involve a name change for our servers.  Is there an easy way we can update the cross server links in our views, sp etc withouth having to go into each view and sp?

Thanks,

Eloise</description>
		<content:encoded><![CDATA[<p>This is a great find, but it&#8217;s not exactly what I need.</p>
<p>We&#8217;re looking at upgrading our servers from 2005 to 2008.  This will also involve a name change for our servers.  Is there an easy way we can update the cross server links in our views, sp etc withouth having to go into each view and sp?</p>
<p>Thanks,</p>
<p>Eloise</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vikul</title>
		<link>http://blog.sqlauthority.com/2008/08/26/sql-server-how-to-rename-a-column-name-or-table-name/#comment-56373</link>
		<dc:creator>Vikul</dc:creator>
		<pubDate>Sat, 03 Oct 2009 06:24:52 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=888#comment-56373</guid>
		<description>Thanks for this information</description>
		<content:encoded><![CDATA[<p>Thanks for this information</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Manish</title>
		<link>http://blog.sqlauthority.com/2008/08/26/sql-server-how-to-rename-a-column-name-or-table-name/#comment-56142</link>
		<dc:creator>Manish</dc:creator>
		<pubDate>Thu, 24 Sep 2009 20:48:12 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=888#comment-56142</guid>
		<description>thanks sir,
it was urgent to me find the ans. for my exam</description>
		<content:encoded><![CDATA[<p>thanks sir,<br />
it was urgent to me find the ans. for my exam</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Uttam</title>
		<link>http://blog.sqlauthority.com/2008/08/26/sql-server-how-to-rename-a-column-name-or-table-name/#comment-55964</link>
		<dc:creator>Uttam</dc:creator>
		<pubDate>Fri, 18 Sep 2009 02:54:21 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=888#comment-55964</guid>
		<description>Thanks Brian Sir.
It really helped.
Really appreciate your quick help.
THanks once again.</description>
		<content:encoded><![CDATA[<p>Thanks Brian Sir.<br />
It really helped.<br />
Really appreciate your quick help.<br />
THanks once again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian Tkatch</title>
		<link>http://blog.sqlauthority.com/2008/08/26/sql-server-how-to-rename-a-column-name-or-table-name/#comment-55954</link>
		<dc:creator>Brian Tkatch</dc:creator>
		<pubDate>Thu, 17 Sep 2009 17:33:18 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=888#comment-55954</guid>
		<description>@Uttam

Use the visual editor. Right click on the TABLE and choose &quot;design&quot;. You can change the name there.</description>
		<content:encoded><![CDATA[<p>@Uttam</p>
<p>Use the visual editor. Right click on the TABLE and choose &#8220;design&#8221;. You can change the name there.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Uttam</title>
		<link>http://blog.sqlauthority.com/2008/08/26/sql-server-how-to-rename-a-column-name-or-table-name/#comment-55950</link>
		<dc:creator>Uttam</dc:creator>
		<pubDate>Thu, 17 Sep 2009 16:56:17 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=888#comment-55950</guid>
		<description>I have used the renaming mistakenly and my column name now looks like this “[column]” without the quotation mark but including the [] charecters. How can I reissue the command to rename the column? what escape sequence should I use.

eg:: if coloumn name is txtname
after renaming using sp_rename with new coloumn name it is showing [txtname_new].

Now I cant even retrieve the values for that coloumn.
Please help me guys on this...

Thanks in advance.</description>
		<content:encoded><![CDATA[<p>I have used the renaming mistakenly and my column name now looks like this “[column]” without the quotation mark but including the [] charecters. How can I reissue the command to rename the column? what escape sequence should I use.</p>
<p>eg:: if coloumn name is txtname<br />
after renaming using sp_rename with new coloumn name it is showing [txtname_new].</p>
<p>Now I cant even retrieve the values for that coloumn.<br />
Please help me guys on this&#8230;</p>
<p>Thanks in advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pulkit</title>
		<link>http://blog.sqlauthority.com/2008/08/26/sql-server-how-to-rename-a-column-name-or-table-name/#comment-55571</link>
		<dc:creator>Pulkit</dc:creator>
		<pubDate>Thu, 03 Sep 2009 18:48:34 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=888#comment-55571</guid>
		<description>i want 2 change a column name that contains a point(.). e.g  . using the sp_rename it is giving an error. plz. solve d problem guys</description>
		<content:encoded><![CDATA[<p>i want 2 change a column name that contains a point(.). e.g  . using the sp_rename it is giving an error. plz. solve d problem guys</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mistake</title>
		<link>http://blog.sqlauthority.com/2008/08/26/sql-server-how-to-rename-a-column-name-or-table-name/#comment-55239</link>
		<dc:creator>mistake</dc:creator>
		<pubDate>Wed, 26 Aug 2009 10:39:20 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=888#comment-55239</guid>
		<description>I have used the renaming mistakenly and my column name now looks like this &quot;[column]&quot; without the quotation mark but including the [] charecters. How can I reissue the command to rename the column? what escape sequence should I use.</description>
		<content:encoded><![CDATA[<p>I have used the renaming mistakenly and my column name now looks like this &#8220;[column]&#8221; without the quotation mark but including the [] charecters. How can I reissue the command to rename the column? what escape sequence should I use.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Cain</title>
		<link>http://blog.sqlauthority.com/2008/08/26/sql-server-how-to-rename-a-column-name-or-table-name/#comment-55203</link>
		<dc:creator>Robert Cain</dc:creator>
		<pubDate>Tue, 25 Aug 2009 18:56:22 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=888#comment-55203</guid>
		<description>Once again Pinal Dave&#039;s blog to the rescue! Thanks again for a great blog.</description>
		<content:encoded><![CDATA[<p>Once again Pinal Dave&#8217;s blog to the rescue! Thanks again for a great blog.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bushy</title>
		<link>http://blog.sqlauthority.com/2008/08/26/sql-server-how-to-rename-a-column-name-or-table-name/#comment-55046</link>
		<dc:creator>Bushy</dc:creator>
		<pubDate>Thu, 20 Aug 2009 08:56:02 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=888#comment-55046</guid>
		<description>Thanx a lot these is really helpfull, You really can make articles very simple to understand....</description>
		<content:encoded><![CDATA[<p>Thanx a lot these is really helpfull, You really can make articles very simple to understand&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rashmi</title>
		<link>http://blog.sqlauthority.com/2008/08/26/sql-server-how-to-rename-a-column-name-or-table-name/#comment-54860</link>
		<dc:creator>Rashmi</dc:creator>
		<pubDate>Fri, 14 Aug 2009 16:44:54 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=888#comment-54860</guid>
		<description>This is really useful info
Thanks for providing very good and to the point info</description>
		<content:encoded><![CDATA[<p>This is really useful info<br />
Thanks for providing very good and to the point info</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vamsi</title>
		<link>http://blog.sqlauthority.com/2008/08/26/sql-server-how-to-rename-a-column-name-or-table-name/#comment-54519</link>
		<dc:creator>vamsi</dc:creator>
		<pubDate>Thu, 06 Aug 2009 11:01:03 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=888#comment-54519</guid>
		<description>Hi Pinal,
I think there is no need to pass third parameter as &#039;column&#039; for renaming the column.

sp_rename &#039;Table_First.Name&#039;, NameChange

i have just tried without mentioning &#039;column&#039; and it works fine.
May i know what is the importance of the third parameter &#039;column&#039;? Is it required or not?</description>
		<content:encoded><![CDATA[<p>Hi Pinal,<br />
I think there is no need to pass third parameter as &#8216;column&#8217; for renaming the column.</p>
<p>sp_rename &#8216;Table_First.Name&#8217;, NameChange</p>
<p>i have just tried without mentioning &#8216;column&#8217; and it works fine.<br />
May i know what is the importance of the third parameter &#8216;column&#8217;? Is it required or not?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pramod</title>
		<link>http://blog.sqlauthority.com/2008/08/26/sql-server-how-to-rename-a-column-name-or-table-name/#comment-54130</link>
		<dc:creator>pramod</dc:creator>
		<pubDate>Mon, 27 Jul 2009 11:28:41 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=888#comment-54130</guid>
		<description>Hi pinal,

thnx for the info.</description>
		<content:encoded><![CDATA[<p>Hi pinal,</p>
<p>thnx for the info.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shital Kasliwal</title>
		<link>http://blog.sqlauthority.com/2008/08/26/sql-server-how-to-rename-a-column-name-or-table-name/#comment-51239</link>
		<dc:creator>Shital Kasliwal</dc:creator>
		<pubDate>Thu, 23 Apr 2009 11:13:20 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=888#comment-51239</guid>
		<description>Hi,
  This Script is Running Correctly. 

Thanks Sir.</description>
		<content:encoded><![CDATA[<p>Hi,<br />
  This Script is Running Correctly. </p>
<p>Thanks Sir.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sunder</title>
		<link>http://blog.sqlauthority.com/2008/08/26/sql-server-how-to-rename-a-column-name-or-table-name/#comment-51040</link>
		<dc:creator>Sunder</dc:creator>
		<pubDate>Thu, 16 Apr 2009 11:52:12 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=888#comment-51040</guid>
		<description>hi 

thanx sir this is very nice</description>
		<content:encoded><![CDATA[<p>hi </p>
<p>thanx sir this is very nice</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ramesh</title>
		<link>http://blog.sqlauthority.com/2008/08/26/sql-server-how-to-rename-a-column-name-or-table-name/#comment-48317</link>
		<dc:creator>Ramesh</dc:creator>
		<pubDate>Sat, 07 Mar 2009 07:36:54 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=888#comment-48317</guid>
		<description>hi,

i want to rename the table column using sql queries. can anyone help me ?

Thanks,
Ramesh</description>
		<content:encoded><![CDATA[<p>hi,</p>
<p>i want to rename the table column using sql queries. can anyone help me ?</p>
<p>Thanks,<br />
Ramesh</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ritesh</title>
		<link>http://blog.sqlauthority.com/2008/08/26/sql-server-how-to-rename-a-column-name-or-table-name/#comment-46562</link>
		<dc:creator>ritesh</dc:creator>
		<pubDate>Wed, 11 Feb 2009 11:44:46 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=888#comment-46562</guid>
		<description>hii....bhai tera bahut bahut dhanyawad....</description>
		<content:encoded><![CDATA[<p>hii&#8230;.bhai tera bahut bahut dhanyawad&#8230;.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
