Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does 'vw' mean in this SQL statement?

Tags:

sql

sql-view

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.

like image 619
Christopher Avatar asked Jul 15 '13 23:07

Christopher


People also ask

What is connect permission in SQL Server?

The CONNECT permission allows you to connect to the associated instance or database. In and of itself CONNECT SQL/CONNECT grants no other permissions. You can't query any table or view, execute any function or stored procedure etc.


2 Answers

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

like image 81
DaveShaw Avatar answered Nov 09 '22 04:11

DaveShaw


it's just a prefix, maybe a project name ... vwTournamentDetails could even be Stackoverflow, it's just how someone named the table/view.

normally, we database architects tend to prefix the name with a topic or area, sometimes a project, a simple convention so we know things, when we thing that the same database could contain other tables not relative to what we are design them now... myself, I normally use the project short name, for example mv for the project Mitivo, or tbl for a Table vw for a View, it's how I have being writing tables for more than 20 years and that stick with us... old people... :)

bottom line, it's just a name :)

like image 22
balexandre Avatar answered Nov 09 '22 04:11

balexandre