The Wrecking Bawl
Destructuring query language, one keyword at a time.
Site Sections
Home
Contact
Syndication
Login
Posts
120
Comments
117
Trackbacks
22
<< people who baffle me
|
Home
|
so long Max >>
ALTER TABLE difference in SQL 2005
I think I may have found an undocumented difference between SQL Server 2000 and SQL Server 2005. When you attempt to add a non-null column without a default to an empty table in SQL Server 2000, for some stupid reason it won't let you if you use ALTER TABLE ADD [column]. You are forced to drop and recreate the table with the new column added to the CREATE TABLE statement. This appears to be different than SQL Server 2005, which wisely does allow such a command to execute without error. I haven't found documentation of this anywhere.
posted on Tuesday, August 07, 2007 5:23 AM
Print
Comments
#
re: ALTER TABLE difference in SQL 2005
ManicArchitect
4/9/2008 2:25 PM
It should only allow you to add the column if the table is empty. You can add the column with a default and the drop the default afterward but the non-null column will need values if the table is not empty when you try to add it.
#
re: ALTER TABLE difference in SQL 2005
wyng
10/23/2008 3:40 PM
could share with me the differences? thanks.
#
re:adding new column
velava
7/9/2009 7:17 AM
how to add new column between the exixting columns in the table?
Post Comment
Title
*
Name
*
Email
Url
Comment
*
Remember Me?
Enter the code shown above
Archives
November, 2009 (1)
July, 2009 (1)
June, 2009 (1)
April, 2009 (3)
March, 2009 (1)
February, 2009 (2)
August, 2008 (2)
June, 2008 (1)
May, 2008 (1)
April, 2008 (4)
February, 2008 (3)
January, 2008 (1)
December, 2007 (1)
November, 2007 (1)
October, 2007 (2)
September, 2007 (2)
August, 2007 (3)
July, 2007 (2)
June, 2007 (7)
May, 2007 (6)
April, 2007 (5)
March, 2007 (18)
February, 2007 (22)
January, 2007 (18)
December, 2006 (12)
Post Categories
all tech stuff
all the other stuff
C#
SQL Server
general .Net stuff
News
Copyright © 2005 Alex Bransky
This work is licensed under a
Creative Commons License