Creating table names that are reserved words/keywords in MS SQL Server [closed]
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)
Solution 1:
repeat this three times:
DO NOT DO IT, I WILL NOT USE RESERVED WORDS!
you'll thank me!
Solution 2:
You can create tables with the same name as keywords. If you "quote" the table name it should work. The default quotes in SQL server are square brackets: []
CREATE TABLE [dbo].[user](
[id] [bigint] NOT NULL,
[name] [varchar](20) NOT NULL
) ON [PRIMARY]