阅读背景:

在SQL Server 2014查询结果中提供完全限定的Table.Column名称标头

来源:互联网 

Is there a way to cause SQL Server Management Studio to return query results where the source table names are displayed as prefixes next to each resulting data column name? I'm just manually forming and executing lots of different queries on the fly, queries that bind multiple tables with similarly named columns. I'm doing this to try to learn the ins and outs of an extremely large, undocumented database that has had no relationships established between tables. For instance, table A may have a column named X, but a related table B also has a column named X. I'm finding these similarities as I go, indicating potential relationships between tables. However, when there are several instances of duplicate column names across several large tables I'm trying to bind, it's hard to discern in the query result set whether I'm looking at the X column that comes from table A as opposed to B. I know that I could use the AS keyword and individually relabel my desired columns right in the SELECT clause. And that might be my only recourse if you say so. However, I want to more quickly form queries while I study this database without necessarily making my queries very elaborate right now. It would be great if the SQL Server result sets could have more clearly labeled column headers of the form table.column, for example: A.X, B.X, etc. That would suffice. How can I make SQL Server 2014 display such qualified column headers?Is there a way to cause SQL Server Management S




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: