选择视图的列 [英] Select Columns of a View

查看:22
本文介绍了选择视图的列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图以与从 information_schema.columns 中选择类似的方式来选择 view 的列名.

I'm attempting to select the column names of a view in a similar way as selecting from information_schema.columns.

我似乎找不到办法做到这一点.有没有其他人以前做过这个或者知道它是否可能?

I can't seem to find a way to do this. Has anyone else done this before or know if it is even possible?

推荐答案

information_schema.columns.Table_name(至少在 Sql Server 2000 下)包括视图,所以只需使用

information_schema.columns.Table_name (at least under Sql Server 2000) includes views, so just use

SELECT * FROM information_schema.columns WHERE table_name = 'VIEW_NAME'

这篇关于选择视图的列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆