In SQL SERVER how would I write a SQL statement to set a column of null values to an emptry string?
so that any value in a column that is <null> would change to ""
Printable View
In SQL SERVER how would I write a SQL statement to set a column of null values to an emptry string?
so that any value in a column that is <null> would change to ""
update tablename
set columnname = ''
where samecolumnname is null
I tried that but it gave me an errorQuote:
Originally posted by rickm
update tablename
set columnname = ''
where samecolumnname is null
Did you replace the tablename with the actual tablename and the columnnames with the actual columnnames? What was the error.Quote:
Originally posted by kleinma
I tried that but it gave me an error
lol ya...
I actually tried that before i posted this.. i am not at work anymore.. i can post the exact error tomorrow..
it was something like can't insert value try using a space instead or something like that.. and it is sql server 2000
By the way.. when i said i wanted to insert "" i mean i want to insert a zero length string.. i don't know why i didn't say that from the start..
ok you have to insert ' ' into the table... that is seen as a zero length string to SQL server... for some reason it needs the space...