Home > Archive > MS SQL Server > April 2006 > Problem with parenthesis in the default value of a column









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Problem with parenthesis in the default value of a column
artur

2006-04-07, 1:23 pm

I am having a problem with the format of default values in SQL Server 2005. I
am using a legacy application that is not expecting the double parenthesis
around the default value that SQL Server adds. For instance, if
I set 0 (zero) as the default value for a column of type int as follows

ALTER TABLE Entity ADD CONSTRAINT & #91;DF_Entity_Class]
DEFAULT 0 FOR
Class)

then SQL Server will set the default value as ((0)). The problem is that the
legacy application is validating the default values and expecting just 0. I
own the database but have no control over the application. Therefore, I
cannot change the application to remove the parenthesis after reading the
value.

Is there any way to force SQL Server to store the default value without the
parenthesis or to return it without the parenthesis (note that the
application is reading the database tables directly).

Regards,
Artur
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com