Blog Pages

Update string add spaces to the input text

Can it be that we will try to update a string and SQL add spaces to it while updating the column?

Answer: Yes!
Char and nchar data types fill the string to the defined text.

An example: 
If a column declared as char 3, and we will run

UPDATE MyTable SET CharColumn = 'AA' WHERE id = 1

and the value there will be set to 'AA ' !

No comments:

Post a Comment