L. Havrlisan L. Havrlisan - 4 months ago 7
SQL Question

Inserting a character in the beginning of a string in SQL

I need to change all the 'PostalCode' column strings by setting a character 'A' at the beginning of the string. I've tried this:

UPDATE Customers SET PostalCode = STUFF(PostalCode , 0 , 1 , 'A')


But nothing... Any ideas?

Answer

You can try to use CONCAT

UPDATE Customers
SET PostalCode = CONCAT('A', PostalCode )