1
如果行中的數據是錯誤的,那麼每個表中都有一個列標誌值爲'N'。此標誌列通過運行驗證腳本進行更新。在運行腳本之前,我需要將這些列設置爲'Y'。如何使用sp_MSforeachtable更新存在於數據庫所有表中的列?
如果行中的數據是錯誤的,那麼每個表中都有一個列標誌值爲'N'。此標誌列通過運行驗證腳本進行更新。在運行腳本之前,我需要將這些列設置爲'Y'。如何使用sp_MSforeachtable更新存在於數據庫所有表中的列?
EXEC sp_MSforeachtable 'UPDATE ? SET YourColumn = ''Y'''
感謝它工作:) –
給我們看一些代碼 –