<?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; Add Column With Default Column Constraint to Table</title>
	<atom:link href="http://blog.sqlauthority.com/2008/03/19/sql-server-add-column-with-default-column-constraint-to-table/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2008/03/19/sql-server-add-column-with-default-column-constraint-to-table/</link>
	<description>Notes of a SQL Server MVP and Database Administrator</description>
	<lastBuildDate>Sun, 21 Mar 2010 03:48:32 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Akhila</title>
		<link>http://blog.sqlauthority.com/2008/03/19/sql-server-add-column-with-default-column-constraint-to-table/#comment-60748</link>
		<dc:creator>Akhila</dc:creator>
		<pubDate>Sat, 06 Feb 2010 02:00:12 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=541#comment-60748</guid>
		<description>Hi Simon

An Example you can test on Adventure works

select Name, GroupName, 2.7 as Constant from HumanResources.Department</description>
		<content:encoded><![CDATA[<p>Hi Simon</p>
<p>An Example you can test on Adventure works</p>
<p>select Name, GroupName, 2.7 as Constant from HumanResources.Department</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eduardo</title>
		<link>http://blog.sqlauthority.com/2008/03/19/sql-server-add-column-with-default-column-constraint-to-table/#comment-57330</link>
		<dc:creator>Eduardo</dc:creator>
		<pubDate>Wed, 04 Nov 2009 15:20:30 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=541#comment-57330</guid>
		<description>Thanks for the solution. Works!</description>
		<content:encoded><![CDATA[<p>Thanks for the solution. Works!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Guilherme</title>
		<link>http://blog.sqlauthority.com/2008/03/19/sql-server-add-column-with-default-column-constraint-to-table/#comment-55268</link>
		<dc:creator>Guilherme</dc:creator>
		<pubDate>Wed, 26 Aug 2009 19:08:25 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=541#comment-55268</guid>
		<description>até que enfim um exemplo simples e eficaz. boa=good!</description>
		<content:encoded><![CDATA[<p>até que enfim um exemplo simples e eficaz. boa=good!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon</title>
		<link>http://blog.sqlauthority.com/2008/03/19/sql-server-add-column-with-default-column-constraint-to-table/#comment-48058</link>
		<dc:creator>Simon</dc:creator>
		<pubDate>Thu, 05 Mar 2009 01:46:28 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=541#comment-48058</guid>
		<description>I have an existing query which return 1000 of rows, i want to add another column and have constant numerical value (2.7 for example).   can someone tell me how to do that? many thanks</description>
		<content:encoded><![CDATA[<p>I have an existing query which return 1000 of rows, i want to add another column and have constant numerical value (2.7 for example).   can someone tell me how to do that? many thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Musab</title>
		<link>http://blog.sqlauthority.com/2008/03/19/sql-server-add-column-with-default-column-constraint-to-table/#comment-44463</link>
		<dc:creator>Musab</dc:creator>
		<pubDate>Mon, 01 Dec 2008 11:31:55 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=541#comment-44463</guid>
		<description>Dear Treasa!


ALTER TABLE TableName WITH NOCHECK
ADD CONSTRAINT DF_DefaultName DEFAULT &#039;Default Value&#039; FOR ColumnName



Check it out !</description>
		<content:encoded><![CDATA[<p>Dear Treasa!</p>
<p>ALTER TABLE TableName WITH NOCHECK<br />
ADD CONSTRAINT DF_DefaultName DEFAULT &#8216;Default Value&#8217; FOR ColumnName</p>
<p>Check it out !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Treasa</title>
		<link>http://blog.sqlauthority.com/2008/03/19/sql-server-add-column-with-default-column-constraint-to-table/#comment-43587</link>
		<dc:creator>Treasa</dc:creator>
		<pubDate>Wed, 08 Oct 2008 03:10:23 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=541#comment-43587</guid>
		<description>Hi,

Can someone please tell me how to specify a default constraint  for an existing column?

Thanks in advance!!

Treasa</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Can someone please tell me how to specify a default constraint  for an existing column?</p>
<p>Thanks in advance!!</p>
<p>Treasa</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Imran Mohammed</title>
		<link>http://blog.sqlauthority.com/2008/03/19/sql-server-add-column-with-default-column-constraint-to-table/#comment-40441</link>
		<dc:creator>Imran Mohammed</dc:creator>
		<pubDate>Fri, 18 Jul 2008 16:37:56 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=541#comment-40441</guid>
		<description>@adiraju

If that column you are trying to drop is used by any derived column, then you cannot drop it.

Example: in Example11 I created a table with out any derived column so I was able to drop column ename.

CREATE TABLE EXAMPLE11( EID INT , ENAME VARCHAR(10))
GO
ALTER TABLE EXAMPLE11
DROP COLUMN ENAME
GO

Result:Command(s) completed successfully.

Example2:  In this example I created third column using first and second column, so when I try to drop second column, it gives me an error because second column in used in third column

CREATE TABLE EXAMPLE12 ( COLA INT, COLB INT , COLC AS COLA + COLB )
GO
ALTER TABLE EXAMPLE12
DROP COLUMN COLB
Go 
Result: Msg 5074, Level 16, State 1, Line 1
The column &#039;colc&#039; is dependent on column &#039;COLB&#039;.
Msg 4922, Level 16, State 9, Line 1
ALTER TABLE DROP COLUMN COLB failed because one or more objects access this column.


Hope this helps.
Thanks,
Imran.</description>
		<content:encoded><![CDATA[<p>@adiraju</p>
<p>If that column you are trying to drop is used by any derived column, then you cannot drop it.</p>
<p>Example: in Example11 I created a table with out any derived column so I was able to drop column ename.</p>
<p>CREATE TABLE EXAMPLE11( EID INT , ENAME VARCHAR(10))<br />
GO<br />
ALTER TABLE EXAMPLE11<br />
DROP COLUMN ENAME<br />
GO</p>
<p>Result:Command(s) completed successfully.</p>
<p>Example2:  In this example I created third column using first and second column, so when I try to drop second column, it gives me an error because second column in used in third column</p>
<p>CREATE TABLE EXAMPLE12 ( COLA INT, COLB INT , COLC AS COLA + COLB )<br />
GO<br />
ALTER TABLE EXAMPLE12<br />
DROP COLUMN COLB<br />
Go<br />
Result: Msg 5074, Level 16, State 1, Line 1<br />
The column &#8216;colc&#8217; is dependent on column &#8216;COLB&#8217;.<br />
Msg 4922, Level 16, State 9, Line 1<br />
ALTER TABLE DROP COLUMN COLB failed because one or more objects access this column.</p>
<p>Hope this helps.<br />
Thanks,<br />
Imran.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: adiraju</title>
		<link>http://blog.sqlauthority.com/2008/03/19/sql-server-add-column-with-default-column-constraint-to-table/#comment-40438</link>
		<dc:creator>adiraju</dc:creator>
		<pubDate>Fri, 18 Jul 2008 15:41:12 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=541#comment-40438</guid>
		<description>hello sir,

     i could not delete a column in a table through &#039; drop column&#039; option in &#039;alter table&#039; query even though the column is not having any relationships or any other constraints. 
  please help me.

with regards,
adiraju</description>
		<content:encoded><![CDATA[<p>hello sir,</p>
<p>     i could not delete a column in a table through &#8216; drop column&#8217; option in &#8216;alter table&#8217; query even though the column is not having any relationships or any other constraints.<br />
  please help me.</p>
<p>with regards,<br />
adiraju</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Larry</title>
		<link>http://blog.sqlauthority.com/2008/03/19/sql-server-add-column-with-default-column-constraint-to-table/#comment-34498</link>
		<dc:creator>Larry</dc:creator>
		<pubDate>Fri, 21 Mar 2008 18:57:56 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=541#comment-34498</guid>
		<description>Dave,

I think something is wrong with your blog software.  The new blog post today is labeled as the 19th, but you posted it today, 3/21.  Just wanted you to be aware.</description>
		<content:encoded><![CDATA[<p>Dave,</p>
<p>I think something is wrong with your blog software.  The new blog post today is labeled as the 19th, but you posted it today, 3/21.  Just wanted you to be aware.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
