7

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.

nathanchere
  • 8,008
  • 15
  • 65
  • 86
Christopher
  • 169
  • 1
  • 2
  • 10
  • 1
    I would also lookup using [Parameterized](http://www.dotnetperls.com/sqlparameter) SQL statements from C#. This example could suffer from SQL Injection. – DaveShaw Jul 15 '13 at 23:34

5 Answers5

20

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

DaveShaw
  • 52,123
  • 16
  • 112
  • 141
2

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 :)

balexandre
  • 73,608
  • 45
  • 233
  • 342
0

It's just a prefix but it is a common prefix for views.

Kevin
  • 4,586
  • 23
  • 35
0

The vw is likely a prefix for view. Look among tbe views, and you should find one named vwTournamentDetails.

Guffa
  • 687,336
  • 108
  • 737
  • 1,005
0

This is probably an abbreviation for "view". So you don't have a table with this name but a view.
http://msdn.microsoft.com/en-us/library/aa214068%28v=sql.80%29.aspx

Azrael
  • 161
  • 1
  • 7