L. Havrlisan L. Havrlisan -5 years ago 104
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 Source

You can try to use CONCAT

UPDATE Customers
SET PostalCode = CONCAT('A', PostalCode )
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download