I usually can find answers to my questions in SO, but I can't find information on this topic (may be I'm making the wrong question).
Background: six years ago some developer upsized a Visual FoxPro data base to SQL Server 2005 (tables structure and data). The process introduced various bugs that now I'm trying to fix in order to improve the data structure and performance (changing TEXT to VARCHAR(MAX), some Floats to DECIMAL, dropping unused columns...)
My previous task was: to find all Default Constraints assigned to all columns in all tables for which the corresponding default object didn't exist in sys.default_constraints
and fix them assigning an empty string to char
/varchar
, 0
to Decimal
, etc... (more than 30% of columns where broken... yes I know -_- wtf!. My script worked smoothly, so far so good.
Just for fun I executed SP_HELP
in one of those tables to verify the fixed columns, but noticed that the char
columns I didn't change had a default value of (space((1)))
, instead of the plain empty string ''
I was using.
My question is: Should I leave those columns intact with the default value (space((1)))
? or should I change it to ''
(changing the script to do that would be really easy)?
My bet is that I should change it (calling a function on every insert can't be free), but wanted to ask to be sure first.
PD: I'm not a DBA, but a developer who has to use the DBA hat now and then.