当你的才华不能撑起你的野心时,就是你该选择学习的时候了!

SQL Server取视图和视图的字段

SELECT 
    v.name AS ViewName,
    c.name AS ColumnName
FROM 
    sys.views v
INNER JOIN 
    sys.columns c ON v.object_id = c.object_id
WHERE 
    v.name = 'YourViewName'
SELECT 
    m.definition AS ViewDefinition
FROM 
    sys.views v
INNER JOIN 
    sys.sql_modules m ON v.object_id = m.object_id
WHERE 
    v.name = 'YourViewName'

 

posted @ 2024-01-09 10:45  hofmann  阅读(71)  评论(0编辑  收藏  举报