Monday, March 19, 2012

I want a default value of space

I'm using MSDE and I'd like to set a default value of a space (or spaces), and in design-view, it lets me enter a space. But it is interpreted as an empty-string "" which gets converted to Nulls when it is moved to another string field? I'm not sure why. Is there any way around this?
Are wrapping it in quotes?|||In testing, no matter what I do I cannot make SQL Server assign thedefault value of a single space or multiple spaces to a column. It always assigns an empty string. For reference, this is what Iam indicating for the default value:
(' ')
I thought it might have had to do with the varchar data type, so Ichanged it to char and had the same result. I am also stumped.
|||

It's nice to know I'm not alone. I'm doing the same - wrapping it in quotes. The problem is - it is interpreted as hex '00' when I move it to another string (which is part of a record I'm transmitting to a remote server) and this server can not handle NULL values. So unless I find a solution, I have to convert all with "empty-string" to " " before I send them. ouch.

If you find a solution, please let me know and I'll do the same.

Thanks,

John Pavelka

No comments:

Post a Comment