1
General Board / Re: Column Default (SQL Server)
« on: August 27, 2007, 06:30:23 am »
Problem is EA (6.5 & 7) will produce the following SQL when a default of 0 is assigned to a column =>
create table test columna int NOT NULL default (0)
What is required (EA cannot do this) is the ability to name the default by adding a default constraint so that it can be consistanly referred to in SQL DML scripts. By not supplying a name SQL Server allocates a system generated name at run time. This means a different SQL script has to be written for each environment that requires change. =>
create table test columna int NOT NULL constraint DF_test_columna DEFAULT (0)
create table test columna int NOT NULL default (0)
What is required (EA cannot do this) is the ability to name the default by adding a default constraint so that it can be consistanly referred to in SQL DML scripts. By not supplying a name SQL Server allocates a system generated name at run time. This means a different SQL script has to be written for each environment that requires change. =>
create table test columna int NOT NULL constraint DF_test_columna DEFAULT (0)