Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating table names that are reserved words/keywords in MS SQL Server [closed]

Tags:

sql

sql-server

Is it ok to name my database tables that are already keywords? For my case, I am trying to name the table that will hold my users. I've named it User but it is showing up as pink in SQL Server Management Studio so I am assuming its an existing System Table or Keyword. Thanks for your advice.

Official list of reserved keywords: Reserved Keywords (Transact-SQL)

like image 608
EverTheLearner Avatar asked Mar 29 '09 23:03

EverTheLearner


People also ask

How do you do a reserved word in SQL?

If you desire to use a reserved word is used as an object name in ANSI standard syntax, it must be enclosed in double-quotes to allow the Relational Engine (whichever that one is) that the word is being used as an object and not as a keyword in the given context.

Can we use reserved words for naming database objects?

If you use a reserved word or symbol to name a field in a desktop database or web app table, Access warns you that the word is reserved and that you might encounter errors when referring to the field. You might also encounter errors if you use a reserved word to name a control, an object, or a variable.

Is name reserved keyword in SQL?

SQL Server does not have to distinguish this as a reserved keyword. Transact-SQL reserved keywords can be used as identifiers or names of databases or database objects, such as tables, columns, views, and so on. Use either quoted identifiers or delimited identifiers.


1 Answers

repeat this three times:

DO NOT DO IT, I WILL NOT USE RESERVED WORDS!

you'll thank me!

like image 70
racer x Avatar answered Sep 27 '22 00:09

racer x