How do I update several tables with columns that store social security number as a single transaction? I have over 70 tables to update the ssn with correct ssn.The database I'm working on is not normalized.
The update is strictly by request. Occasionally, I get calls for a customer who entered their ssn wrongly the first time they registered on the our website. when I get such a request, I manually update all the ssn in every database table that stores information about the customer. A very tedious task to update over 70 tables with ssn columns one by one. Does anyone have an idea how to do this efficiently ?Can someone show me how write a stored procedure that I can pass in the old SSN and the new SSN then it updates the 70 tables accordingly?
Does anyone have a blue print that demonstrates how to write the stored procedure?
TableName ColumnName
table1 colA
table2 colB
table3 colC
table4 cold
I query the INFORMATION_SCHEMA.COLUMNS
view
to retrieve all the tables that have ssn columns as shown above.