SQL Alter statement
April 6, 2011 6:56 AM Subscribe
SQL SERVER: Need help creating new column in a table with unformatted SSN.
posted by fozzie33 to Computers & Internet (6 answers total)
Some of the SSN's in a database are written with dashes, XXX-XX-XXXX. In other tables the SSN's are just XXXXXXXXX.
I'd like to create a new column in the tables where the SSN is formatted with dashes that replaces the the - with nothing, so that it is formatted as XXXXXXXXX.
Any help with this statement, i thought it was:
ALTER TABLE tablename
ADD columnName AS REPLACE(SSN,"-","")
Let me know what you think