I'm coming from an Oracle background and came across code to create a SQL Server view which I've never seen before.
We have a view called viewA (for example)
Within the script to generate the view I see this code
select columnA, columnB, columnC
from tableA as vw_tableB
The question I have is, what is the view really called?
Is it viewA or vw_tableB.
The other question I have is what is the rationale behind this?
Best Answer
The view is called whatever is listed in the CREATE statement, which would look like this in the script.
The vw_tableB is an table alias https://technet.microsoft.com/en-us/library/ms187455.aspx