question

RameshReddyMallidi-1804 avatar image
0 Votes"
RameshReddyMallidi-1804 asked DanGuzman edited

If i use SQL Server key name( like where , select, value ) as one of the column name in my user defined table, is there any performance impact ?

Hi Experts, In one of my table, i had column name "Value". but when i write any T-SQL statement by using that column, it is appeared as blue color since it is system defined keyword. so is there is any performance issue or other issues if I use SQL server key words as column names. Please provide me insights for this. Thanks in advance.

sql-server-generalsql-server-transact-sql
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

EchoLiu-msft avatar image
1 Vote"
EchoLiu-msft answered EchoLiu-msft edited

When you want to use sql server keywords as column names, you can use [],
for example:

      [values]

in the form of [], it has no effect on performance.But it is not recommended to use sql server keywords as column names.


Regards
Echo


If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

OlafHelper-2800 avatar image
1 Vote"
OlafHelper-2800 answered DanGuzman edited

"Value" is a Reserved Keywords (Transact-SQL), you should avoid using them for user object names.
Blue is the syntax high lightning of SSMS and has no further effect; see Color Coding in Query Editors


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Adding that VALUE is not listed under current reserved keywords and is this thus currently allowed without quoting the identifier. However, it is listed as a ODBC keyword and a future keyword so one should avoid using it as an identifier.

0 Votes 0 ·