Groups | Blog | Home
all groups > sql server (alternate) > may 2004 >

sql server (alternate) : Allow zero length


William Kossack
5/21/2004 9:25:53 AM
We ran into a problem loading access where tables where if we did not
select the property allow zero length we got an error message when
loading data with some empty values.

We are now ramping up SQL server and the question came up will SQL
server have the same problem with empty data values.

Is there an SQL server equivalent to allow zero length?
William Kossack
5/21/2004 12:48:41 PM
thanks

[quoted text, click to view]
Gert-Jan Strik
5/21/2004 8:25:50 PM
SQL-Server will always allow zero length values, unless you explicitely
add a constraint to disallow this.

So, by default, zero length values are allowed. If you do not want that,
you could run

ALTER TABLE mytable
ADD CONSTRAINT constraintname
CHECK (mycol <> '')

for each relevant column.

Hope this helps,
Gert-Jan


[quoted text, click to view]

--
AddThis Social Bookmark Button