I need to make a script that goes through all tables, and select those columns where name is specified.
I can find the columns where names are specified,
SELECT sys.columns.name AS ColumnName, tables.name AS TableName
FROM sys.columns
JOIN sys.tables ON sys.columns.object_id = tables.object_id
AND sys.columns.name LIKE 'name'
but how do in SQL loop through each row of the select statement and exectute an update command on the table TableName
and and column ColumnName
, and update the content to something like
'Anon'?