What does 'vw' mean in this SQL statement?

Christopher picture Christopher · Jul 16, 2013 · Viewed 8.5k times · Source

What does vw mean in front of TournamentDetails?

SELECT * FROM vwTournamentDetails WHERE
    firstname='@firstName'
    AND lastname='@lastName' 
    AND --etc

Where is the table TournamentDetails coming from? We have no table named TournamentDetails.

Answer

DaveShaw picture DaveShaw · Jul 16, 2013

It's a View, if you have a read of that link, Microsoft do a good job of explaining what a view is and why someone might use one.

"vw" is a common prefix for a View.

If you expand the "Views" section in SSMS you should see the View call vwTournamentDetails.

Here are the views from my AdventureWorks2012 Database:

Adventure Works 2012 Views