更新时间:2022-11-28 07:47:03
在 Management Studio 中,打开对象资源管理器.
In Management Studio, open the Object Explorer.
Views
Script view as >创建到 >新建查询窗口
大功告成!
如果要从 T-SQL 代码中检索定义视图的 SQL 语句,请使用:
If you want to retrieve the SQL statement that defines the view from T-SQL code, use this:
SELECT
m.definition
FROM sys.views v
INNER JOIN sys.sql_modules m ON m.object_id = v.object_id
WHERE name = 'Example_1'