GO  
SELECT DISTINCT 'EXEC sp_refreshview ''' + name + ''''   
FROM sys.objects AS so   
INNER JOIN sys.sql_expression_dependencies AS sed   
    ON so.object_id = sed.referencing_id   
WHERE so.type = 'V' AND sed.referenced_id = OBJECT_ID('dbo.table');  

表新增字段后会,导致视图字段对不上

使用 

sp_refreshview 进行刷新视图

相关文章:

  • 2021-07-18
  • 2022-12-23
  • 2022-12-23
  • 2021-05-22
  • 2022-12-23
  • 2022-02-06
  • 2022-12-23
  • 2021-11-18
猜你喜欢
  • 2022-01-10
  • 2022-12-23
  • 2021-05-20
  • 2022-12-23
  • 2021-09-23
  • 2022-12-23
相关资源
相似解决方案