Is "Version" a reserved word in TRANSACT-SQL? (Shows blue, but not in the list of reserved words)

I wrote the Stored Procedure today and wrote the line:

 SELECT pv1.Version FROM depl... 

and the word Version shown in blue, as shown below:

enter image description here

therefore, I suggested that this is a reserved word, so some research here:

Reserved Keywords (TRANSACT-SQL)

But could not find the word Version in the list.

Is Version reserved SQL word, and if not, why is my Version word displayed in blue? I am using SQL Management Studio 2012

+5
source share
4 answers

As you correctly noted, Version not in the official list of reserved words. This is simply a β€œfeature” of SQL Server Management Studio that shows it in blue.

There are many such words. Here are a few more:

 DESCRIPTION SERVER INSTEAD 

There are even some words that appear pink, such as LOOKUP .

+3
source

"Version" is not a reserved SQL Server keyword.

However, it is used in a global variable used to display the OS name and version, SQL Server version, SQL Server fixes, and hardware attributes used by SQL Server.

 SELECT @@VERSION 

The Version text may turn blue in Transact-SQL because it is known by SQL Server in the context of this global variable. I am not sure about this, this is just a theory.

+1
source

The short answer is no, it is not. Here's an SQLFiddle that uses it as the column name in SQL Server 2014 to prove it.

0
source

I think you can always, if in doubt, put your column name in brackets to use the reserved words as column names:

select p1.[Version] from dpl...

0
source

All Articles