The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 2,114 other followers

Archive for September 15th, 2010

SQL Server: alternative to “ALTER TABLE TableName ALTER COLUMN ColumnName DROP DEFAULT”

Posted by jpluimers on 2010/09/15

SQL Server used to support the “ALTER TABLE TableName ALTER COLUMN ColumnName DROP DEFAULT”:

In the current Books Online version for the SQL Server 2005 version of ALTER TABLE documentation, the “DROP DEFAULT” has been disappeared.
In the SQL Server 2005 documentation, Microsoft already indicated that the “DROP DEFALT” would be removed in a future version.
I was surprised it already had disappeared in SQL Server 2005 Service Pack 3, especially since it is documented to be removed after SQL Server 2008 R2.

By removing this feature, SQL Server is moving further away from the SQL-92 standard.

Anyway: When you try to perform a ALTER TABLE TableName ALTER COLUMN ColumnName DROP DEFAULT, now you get this error message:

Incorrect syntax near the keyword ‘DEFAULT’.

Below is how I approached towards a solution. Read the rest of this entry »

Posted in Database Development, Development, SQL Server | Leave a Comment »

 
%d bloggers like this: