<?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>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Fri, 10 Feb 2012 02:12:04 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Arvind baghel</title>
		<link>http://blog.sqlauthority.com/2008/03/19/sql-server-add-column-with-default-column-constraint-to-table/#comment-239408</link>
		<dc:creator><![CDATA[Arvind baghel]]></dc:creator>
		<pubDate>Tue, 17 Jan 2012 13:56:55 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=541#comment-239408</guid>
		<description><![CDATA[Msg 156, Level 15, State 1, Line 2
Incorrect syntax near the keyword &#039;set&#039;.]]></description>
		<content:encoded><![CDATA[<p>Msg 156, Level 15, State 1, Line 2<br />
Incorrect syntax near the keyword &#8216;set&#8217;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shafayat</title>
		<link>http://blog.sqlauthority.com/2008/03/19/sql-server-add-column-with-default-column-constraint-to-table/#comment-212475</link>
		<dc:creator><![CDATA[Shafayat]]></dc:creator>
		<pubDate>Wed, 07 Dec 2011 02:52:24 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=541#comment-212475</guid>
		<description><![CDATA[Thanks. Your suggestion helps me.]]></description>
		<content:encoded><![CDATA[<p>Thanks. Your suggestion helps me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mahesh singh</title>
		<link>http://blog.sqlauthority.com/2008/03/19/sql-server-add-column-with-default-column-constraint-to-table/#comment-202881</link>
		<dc:creator><![CDATA[mahesh singh]]></dc:creator>
		<pubDate>Wed, 23 Nov 2011 12:26:14 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=541#comment-202881</guid>
		<description><![CDATA[i want to add a coloumn name in my table name member aster but it allow only null value otherwise it say it&#039;s not possible try with alter table plz help me
the given error by sql 2005 is :-
&#039;MemberMaster&#039; table
- Unable to modify table.  
ALTER TABLE only allows columns to be added that can contain nulls, or have a DEFAULT definition specified, or the column being added is an identity or timestamp column, or alternatively if none of the previous conditions are satisfied the table must be empty to allow addition of this column. Column &#039;MemberLogin&#039; cannot be added to non-empty table &#039;MemberMaster&#039; because it does not satisfy these conditions.

help help help]]></description>
		<content:encoded><![CDATA[<p>i want to add a coloumn name in my table name member aster but it allow only null value otherwise it say it&#8217;s not possible try with alter table plz help me<br />
the given error by sql 2005 is :-<br />
&#8216;MemberMaster&#8217; table<br />
- Unable to modify table.<br />
ALTER TABLE only allows columns to be added that can contain nulls, or have a DEFAULT definition specified, or the column being added is an identity or timestamp column, or alternatively if none of the previous conditions are satisfied the table must be empty to allow addition of this column. Column &#8216;MemberLogin&#8217; cannot be added to non-empty table &#8216;MemberMaster&#8217; because it does not satisfy these conditions.</p>
<p>help help help</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shambu Sathyan</title>
		<link>http://blog.sqlauthority.com/2008/03/19/sql-server-add-column-with-default-column-constraint-to-table/#comment-179939</link>
		<dc:creator><![CDATA[Shambu Sathyan]]></dc:creator>
		<pubDate>Mon, 17 Oct 2011 14:33:29 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=541#comment-179939</guid>
		<description><![CDATA[Thanks for your valuable time and quick reply.

There are more than 13000 rows for my condition. 
Since I already had computed columns in the table and I want to use the same columns for my new Computed column, I put it in code.
But because of the performance issue I need to do that in the back end itself.]]></description>
		<content:encoded><![CDATA[<p>Thanks for your valuable time and quick reply.</p>
<p>There are more than 13000 rows for my condition.<br />
Since I already had computed columns in the table and I want to use the same columns for my new Computed column, I put it in code.<br />
But because of the performance issue I need to do that in the back end itself.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2008/03/19/sql-server-add-column-with-default-column-constraint-to-table/#comment-179861</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Mon, 17 Oct 2011 09:47:22 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=541#comment-179861</guid>
		<description><![CDATA[How many rows are there in the database? Also why are you doing it via Visula Studio? Have you tried doing the same in Query Analyser?]]></description>
		<content:encoded><![CDATA[<p>How many rows are there in the database? Also why are you doing it via Visula Studio? Have you tried doing the same in Query Analyser?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shambu Sathyan</title>
		<link>http://blog.sqlauthority.com/2008/03/19/sql-server-add-column-with-default-column-constraint-to-table/#comment-179133</link>
		<dc:creator><![CDATA[Shambu Sathyan]]></dc:creator>
		<pubDate>Sat, 15 Oct 2011 07:20:22 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=541#comment-179133</guid>
		<description><![CDATA[Hello Sir,

I have a requirement where in I want to add a Column which can calculate values by its own.
What I want to do is I want to add a expression to that column. 
I could do that in visual studio using Datatable.columns(index).expression. but it consumes lot of time. please help.

Here&#039;s a small scenario
CREATE TABLE #Temp (RowNo int identity(1,1),Quantity Decimal(18,5) ,ID int, StudentID int)  

Insert into #Temp
Select Quantity,ID, StudentID From Student Where ID = 53

Select * from #Temp

Alter Table #Temp Add Calc Decimal(18,5) Default (&#039;[Quantity] * [ID] * 100&#039;)

Select * from #Temp
Drop Table #Temp]]></description>
		<content:encoded><![CDATA[<p>Hello Sir,</p>
<p>I have a requirement where in I want to add a Column which can calculate values by its own.<br />
What I want to do is I want to add a expression to that column.<br />
I could do that in visual studio using Datatable.columns(index).expression. but it consumes lot of time. please help.</p>
<p>Here&#8217;s a small scenario<br />
CREATE TABLE #Temp (RowNo int identity(1,1),Quantity Decimal(18,5) ,ID int, StudentID int)  </p>
<p>Insert into #Temp<br />
Select Quantity,ID, StudentID From Student Where ID = 53</p>
<p>Select * from #Temp</p>
<p>Alter Table #Temp Add Calc Decimal(18,5) Default (&#8216;[Quantity] * [ID] * 100&#8242;)</p>
<p>Select * from #Temp<br />
Drop Table #Temp</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ade Ruyani</title>
		<link>http://blog.sqlauthority.com/2008/03/19/sql-server-add-column-with-default-column-constraint-to-table/#comment-174819</link>
		<dc:creator><![CDATA[Ade Ruyani]]></dc:creator>
		<pubDate>Tue, 04 Oct 2011 03:09:49 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=541#comment-174819</guid>
		<description><![CDATA[Hello... can i change default to another type? and drop the default?

please help me..

thanks for advance
Ade Ruyani]]></description>
		<content:encoded><![CDATA[<p>Hello&#8230; can i change default to another type? and drop the default?</p>
<p>please help me..</p>
<p>thanks for advance<br />
Ade Ruyani</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2008/03/19/sql-server-add-column-with-default-column-constraint-to-table/#comment-173162</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Thu, 29 Sep 2011 10:21:01 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=541#comment-173162</guid>
		<description><![CDATA[It is not possible. You need to drop the column and add new column with default option]]></description>
		<content:encoded><![CDATA[<p>It is not possible. You need to drop the column and add new column with default option</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2008/03/19/sql-server-add-column-with-default-column-constraint-to-table/#comment-173158</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Thu, 29 Sep 2011 10:10:13 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=541#comment-173158</guid>
		<description><![CDATA[Alter table tablename
add newcolumn datatype]]></description>
		<content:encoded><![CDATA[<p>Alter table tablename<br />
add newcolumn datatype</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ram</title>
		<link>http://blog.sqlauthority.com/2008/03/19/sql-server-add-column-with-default-column-constraint-to-table/#comment-173151</link>
		<dc:creator><![CDATA[Ram]]></dc:creator>
		<pubDate>Thu, 29 Sep 2011 09:36:43 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=541#comment-173151</guid>
		<description><![CDATA[How to add new cloumn to table to hold archival status flag]]></description>
		<content:encoded><![CDATA[<p>How to add new cloumn to table to hold archival status flag</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2008/03/19/sql-server-add-column-with-default-column-constraint-to-table/#comment-164689</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Fri, 02 Sep 2011 08:09:12 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=541#comment-164689</guid>
		<description><![CDATA[Note that it will affect newly inserted data not the old data. You need to write update statement to update old data]]></description>
		<content:encoded><![CDATA[<p>Note that it will affect newly inserted data not the old data. You need to write update statement to update old data</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anuj</title>
		<link>http://blog.sqlauthority.com/2008/03/19/sql-server-add-column-with-default-column-constraint-to-table/#comment-164089</link>
		<dc:creator><![CDATA[Anuj]]></dc:creator>
		<pubDate>Thu, 01 Sep 2011 01:47:28 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=541#comment-164089</guid>
		<description><![CDATA[This constraint doesnot add the default value in existing rows in the table??...

ALTER TABLE dbo.utl_site ADD AMI_active CHAR(1) 
CONSTRAINT DF_utl_site_AMI_active  DEFAULT &#039;N&#039; NULL

all of the rows of utl_site still remains NULL not &#039;N&#039;

Can u explain please?]]></description>
		<content:encoded><![CDATA[<p>This constraint doesnot add the default value in existing rows in the table??&#8230;</p>
<p>ALTER TABLE dbo.utl_site ADD AMI_active CHAR(1)<br />
CONSTRAINT DF_utl_site_AMI_active  DEFAULT &#8216;N&#8217; NULL</p>
<p>all of the rows of utl_site still remains NULL not &#8216;N&#8217;</p>
<p>Can u explain please?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2008/03/19/sql-server-add-column-with-default-column-constraint-to-table/#comment-153648</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Thu, 04 Aug 2011 11:41:48 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=541#comment-153648</guid>
		<description><![CDATA[I dont think default values will affect performance]]></description>
		<content:encoded><![CDATA[<p>I dont think default values will affect performance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jaheer</title>
		<link>http://blog.sqlauthority.com/2008/03/19/sql-server-add-column-with-default-column-constraint-to-table/#comment-153547</link>
		<dc:creator><![CDATA[jaheer]]></dc:creator>
		<pubDate>Thu, 04 Aug 2011 07:09:52 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=541#comment-153547</guid>
		<description><![CDATA[What will be the performance impact on inserts if we have default columns for a table]]></description>
		<content:encoded><![CDATA[<p>What will be the performance impact on inserts if we have default columns for a table</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2008/03/19/sql-server-add-column-with-default-column-constraint-to-table/#comment-149132</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Mon, 18 Jul 2011 11:32:13 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=541#comment-149132</guid>
		<description><![CDATA[How will modify data while creating a table? Have it as default value and remove that column from the insert statement]]></description>
		<content:encoded><![CDATA[<p>How will modify data while creating a table? Have it as default value and remove that column from the insert statement</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexis</title>
		<link>http://blog.sqlauthority.com/2008/03/19/sql-server-add-column-with-default-column-constraint-to-table/#comment-148480</link>
		<dc:creator><![CDATA[Alexis]]></dc:creator>
		<pubDate>Fri, 15 Jul 2011 12:34:51 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=541#comment-148480</guid>
		<description><![CDATA[Hi,
          I&#039;m using SQL Server 2008. I&#039;m dynamically creating a Table with default value of &#039;NP&#039; for a some columns. that columns may have &quot;Null&quot; string value, so I would like to set the default value(&quot;NP&quot;) for &quot;Null&quot; string while creating a Table. Please help me on this. If this not possible,please let me know.


Thanks
Alexis]]></description>
		<content:encoded><![CDATA[<p>Hi,<br />
          I&#8217;m using SQL Server 2008. I&#8217;m dynamically creating a Table with default value of &#8216;NP&#8217; for a some columns. that columns may have &#8220;Null&#8221; string value, so I would like to set the default value(&#8220;NP&#8221;) for &#8220;Null&#8221; string while creating a Table. Please help me on this. If this not possible,please let me know.</p>
<p>Thanks<br />
Alexis</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Johnny</title>
		<link>http://blog.sqlauthority.com/2008/03/19/sql-server-add-column-with-default-column-constraint-to-table/#comment-131757</link>
		<dc:creator><![CDATA[Johnny]]></dc:creator>
		<pubDate>Thu, 28 Apr 2011 13:36:02 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=541#comment-131757</guid>
		<description><![CDATA[May i know how to add default value to existing table column?]]></description>
		<content:encoded><![CDATA[<p>May i know how to add default value to existing table column?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2008/03/19/sql-server-add-column-with-default-column-constraint-to-table/#comment-125914</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Fri, 01 Apr 2011 06:11:23 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=541#comment-125914</guid>
		<description><![CDATA[The ordinal position of the column doesnt matter as long as it is used in the specific order in the select statement. If yo still need it, do it via Management studio]]></description>
		<content:encoded><![CDATA[<p>The ordinal position of the column doesnt matter as long as it is used in the specific order in the select statement. If yo still need it, do it via Management studio</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Abhijoy</title>
		<link>http://blog.sqlauthority.com/2008/03/19/sql-server-add-column-with-default-column-constraint-to-table/#comment-125294</link>
		<dc:creator><![CDATA[Abhijoy]]></dc:creator>
		<pubDate>Mon, 28 Mar 2011 04:07:49 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=541#comment-125294</guid>
		<description><![CDATA[The information was quite helpful.Thank you
I have a table with 5 columns and i need to insert my new column after the second column.How do i achieve this.]]></description>
		<content:encoded><![CDATA[<p>The information was quite helpful.Thank you<br />
I have a table with 5 columns and i need to insert my new column after the second column.How do i achieve this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gaurav</title>
		<link>http://blog.sqlauthority.com/2008/03/19/sql-server-add-column-with-default-column-constraint-to-table/#comment-121715</link>
		<dc:creator><![CDATA[Gaurav]]></dc:creator>
		<pubDate>Thu, 03 Mar 2011 14:07:02 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=541#comment-121715</guid>
		<description><![CDATA[thanks for this information. I was using alter table table_name add( First_Name varchar(20), Last_Name varchar(20)) ... but it shows an syntax error.]]></description>
		<content:encoded><![CDATA[<p>thanks for this information. I was using alter table table_name add( First_Name varchar(20), Last_Name varchar(20)) &#8230; but it shows an syntax error.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Madhivanan</title>
		<link>http://blog.sqlauthority.com/2008/03/19/sql-server-add-column-with-default-column-constraint-to-table/#comment-104590</link>
		<dc:creator><![CDATA[Madhivanan]]></dc:creator>
		<pubDate>Fri, 10 Dec 2010 11:14:33 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=541#comment-104590</guid>
		<description><![CDATA[Do it via Management studio]]></description>
		<content:encoded><![CDATA[<p>Do it via Management studio</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Janani</title>
		<link>http://blog.sqlauthority.com/2008/03/19/sql-server-add-column-with-default-column-constraint-to-table/#comment-104433</link>
		<dc:creator><![CDATA[Janani]]></dc:creator>
		<pubDate>Thu, 09 Dec 2010 09:46:42 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=541#comment-104433</guid>
		<description><![CDATA[Hai ...
 i want sql script to  add column in sql table with ordinal position specification. 
is it possible. if Please help me ..]]></description>
		<content:encoded><![CDATA[<p>Hai &#8230;<br />
 i want sql script to  add column in sql table with ordinal position specification.<br />
is it possible. if Please help me ..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2008/03/19/sql-server-add-column-with-default-column-constraint-to-table/#comment-98703</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Tue, 09 Nov 2010 14:29:27 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=541#comment-98703</guid>
		<description><![CDATA[Script the objects and run them in another database. Use import/export wizard to export data]]></description>
		<content:encoded><![CDATA[<p>Script the objects and run them in another database. Use import/export wizard to export data</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zahis</title>
		<link>http://blog.sqlauthority.com/2008/03/19/sql-server-add-column-with-default-column-constraint-to-table/#comment-98642</link>
		<dc:creator><![CDATA[zahis]]></dc:creator>
		<pubDate>Tue, 09 Nov 2010 06:48:22 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=541#comment-98642</guid>
		<description><![CDATA[hi i wanna two existing tables to add in new database how to do this with schema and data????????]]></description>
		<content:encoded><![CDATA[<p>hi i wanna two existing tables to add in new database how to do this with schema and data????????</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Madhivanan</title>
		<link>http://blog.sqlauthority.com/2008/03/19/sql-server-add-column-with-default-column-constraint-to-table/#comment-86887</link>
		<dc:creator><![CDATA[Madhivanan]]></dc:creator>
		<pubDate>Tue, 07 Sep 2010 09:49:16 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=541#comment-86887</guid>
		<description><![CDATA[It means that he saved the post at 19th and publish it 21st only]]></description>
		<content:encoded><![CDATA[<p>It means that he saved the post at 19th and publish it 21st only</p>
]]></content:encoded>
	</item>
</channel>
</rss>

