What is the proper syntax in SQL Server for addressing tables?

前端 未结 7 452
-上瘾入骨i
-上瘾入骨i 2021-01-18 10:05

This seems like a fairly obvious question, but I haven\'t been able to think of the proper term for what I am trying to ask, so coming up with reference material for this ha

7条回答
  •  终归单人心
    2021-01-18 10:14

    While it is possible to use implict names for columns it is a poor choice from a maintainabilty aspect. I never put production code out that doesn't alias every column because, when you go back a year later to change that report or query, you really don't want to have to figure out which of the 20 tables you joined to that it is in. Further, not specifying makes the database work harder to find the column and you have coding more errors where you have column names that are the same in two tables without a reference. It is a good habit to be in to use explict references.

提交回复
热议问题