我想创建一个数据库表,该表的一列存储表或视图的名称。调用我的列“ ViewOrTableName”似乎有点笨拙。是否有通用的类型/名称,可能表示“表”或“视图”?
具体来说,如果语言不同,我将在MS SQL中执行此操作。
答案 0 :(得分:2)
FROM(Transact-SQL)
指定表,视图,派生表和联接表 SQL Server 2017中的DELETE,SELECT和UPDATE语句。
语法
[ FROM { <table_source> } [ ,...n ] ] <table_source> ::= { table_or_view_name [ [ AS ] table_alias ] [ <tablesample_clause> ] [ WITH ( < table_hint > [ [ , ]...n ] ) ] | rowset_function [ [ AS ] table_alias ] [ ( bulk_column_alias [ ,...n ] ) ] | user_defined_function [ [ AS ] table_alias ] | OPENXML <openxml_clause> | derived_table [ [ AS ] table_alias ] [ ( column_alias [ ,...n ] ) ] | <joined_table> | <pivoted_table> | <unpivoted_table> | @variable [ [ AS ] table_alias ] | @variable.function_call ( expression [ ,...n ] ) [ [ AS ] table_alias ] [ (column_alias [ ,...n ] ) ] | FOR SYSTEM_TIME <system_time> }
因此,也许您想使用 table_source
或 table_or_view_name
。