1
Here is the link to the solution I found and used在这个问题中提供的代码应该完全解决我的情况。更新许多表的列值,只有1行受影响
但是,只有1行受到影响。我想知道这是否意味着我应该添加一个循环或其他条件以使其遍历所有表格。
Declare @ColName as nVarchar(100), @NewValue as nVarchar(50)
Set @ColName = 'test_column' -- 'your col name'
Set @NewValue = getDate() -- your date time value
Select 'Update ' + TABLE_NAME + ' set ' + COLUMN_NAME + ' = ''' + @NewValue + '''' From INFORMATION_SCHEMA.COLUMNS Where column_name = 'test_column'
您需要将您的代码添加到问题中。不要只是指向我们的链接,并要求我们猜测。 – Yatrix
谢谢你的建议。我只是更新了代码。希望它能让任何人看到这一点变得轻松。 – user3546425