T-SQL не имеет FOR loop
, возможно, он имеет WHILE (Transact-SQL)
Используйте SQL, как показано ниже:
DECLARE @table_list NVARCHAR -- What data type do I use to hold a list?
DECLARE @column_list NVARCHAR
SET @table_list = (SELECT DISTINCT [ID_TABLE_NAME] FROM dbo.VMO) -- there are more than one results
SET @column_list = (SELECT DISTINCT [USR_COL_NAME] FROM dbo.VMO) -- there are more than one results
WHILE @column_list > @table_list
BEGIN
UPDATE @table
SET @column = '101211'
WHERE @column = '10120'
END;