Saturday, February 25, 2012

default values in SQL Server 2005

I'm running the September CTP of SQL Server 2005 and I noticed that the way default values are scripted and displayed in the tools has changed.

In SQL Server 2000, if I create a table with an INT field with a default value of 0, it gets scripted as

FIELDNAME INT DEFAULT (0)

Enterprise Manager also shows (0). If you type in 0 for the default (no parentheses) and save, it converts it to (0) in the UI, and it will be scripted with one set of parentheses.

In SQL Server 2005 it seems to add an additional set of parentheses. Hence, if you type in 0 for the default in Management Studio, it changes it to ((0))

Furthermore, if you script the table you get
FIELDNAME INT DEFAULT ((0))

Is this change intended? I couldnt find any references in BOL.

Hi,

I've the same problem, do you find a solution?

Kind regards

|||

Why you are using CTP as already full version of SQL 2005 has been released in Nov-2005?

You can use the RTM edition and test, then install the SP1 in this case.

|||This does appear to be fixed in SP1. I dont think it was in the RTM build, and I'm not sure he's saying he's running the CTP. If you look at the time of my post, it was during the beta of SQL Server 2005, and as I recall, it was not fixed by RTM.|||True and I believe we wait until the second poster comes back.|||

I have the same issue with BIT fields on a server with SP1 applied

has this been addressed in SP2 ?

No comments:

Post a Comment