Reserved words and keywords
Many keywords are also reserved words. You can use reserved words anywhere you use identifiers, as long as you quote them.
Below you can find all the words which are reserved or look like.
Non-reserved keywords
Non-reserved keywords have a special meaning in some contexts, but can be used as identifiers in others. You can use non-reserved keywords as aliases.
Keywords |
Reserved | Non-reserved |
ABSOLUTE |
N |
ADD |
R |
ALL |
R |
ALTER |
R |
AND |
R |
ANY |
R |
APPLY |
N |
APPROX_COUNT_DISTINCT |
N |
AS |
R |
ASC |
R |
AUTO |
N |
BEGIN |
R |
BETWEEN |
R |
BIGINT |
N |
BINARY |
N |
BIT |
N |
BREAK |
R |
BY |
R |
CASE |
R |
CAST |
N |
CATCH |
N |
CHAR |
N |
CHARACTER |
N |
CLOSE |
R |
CLUSTERED |
R |
COLLATE |
R |
COMMIT |
R |
COMPUTE |
R |
CONFIGURATION |
N |
CONNECTION |
N |
CONSTRAINT |
R |
CONTAINS |
R |
CONTINUE |
R |
CONVERT |
R |
COUNT |
N |
COUNT_BIG |
N |
CREATE |
R |
CROSS |
R |
CUME_DIST |
N |
CURSOR |
R |
DATABASE |
R |
DATE |
N |
DATETIME |
N |
DATETIME2 |
N |
DATETIMEOFFSET |
N |
DEALLOCATE |
R |
DEC |
N |
DECIMAL |
N |
DECLARE |
R |
DEFAULT |
R |
DELAY |
N |
DELETE |
R |
DELETED |
N |
DENY |
R |
DESC |
R |
DISABLE |
N |
DISTINCT |
R |
DOUBLE_PRECISION |
N |
DROP |
R |
ELSE |
R |
ENABLE |
N |
END |
R |
ESCAPE |
R |
EXCEPT |
R |
EXECUTE |
R |
EXECUTE_ON |
N |
EXISTS |
R |
EXPAND |
N |
EXPLICIT |
N |
FETCH |
R |
FIRST |
N |
FIRST_VALUE |
N |
FLOAT |
N |
FOR |
R |
FORCE |
N |
FORCESCAN |
N |
FORCESEEK |
N |
FOREIGN |
R |
FROM |
R |
FULL |
R |
FUNCTION |
R |
GEOGRAPHY |
N |
GEOMETRY |
N |
GOTO |
R |
GRANT |
R |
GROUP |
R |
GROUPING |
N |
HASH |
N |
HAVING |
R |
HIERARCHYID |
N |
HOLDLOCK |
R |
IDENTITY |
R |
IF |
R |
IMAGE |
N |
IN |
R |
INCLUDE |
N |
INDEX |
R |
INNER |
R |
INSERT |
R |
INSERTED |
N |
INT |
N |
INTEGER |
N |
INTERSECT |
R |
INTO |
R |
IS |
R |
ISOLATION |
N |
JOIN |
R |
KEY |
R |
LAG |
N |
LAST |
N |
LAST_VALUE |
N |
LEAD |
N |
LEFT |
R |
LEVEL |
N |
LIKE |
R |
LOCK_TIMEOUT |
N |
LOOP |
N |
MARK |
N |
MATCHED |
N |
MAX |
N |
MERGE |
R |
MIN |
N |
MONEY |
N |
NATIONAL |
R |
NCHAR |
N |
NEXT |
N |
NOLOCK |
N |
NONCLUSTERED |
R |
NOT |
R |
NOWAIT |
N |
NTEXT |
N |
NULL |
R |
NUMERIC |
N |
NVARCHAR |
N |
OF |
R |
OFF |
R |
OFFSET |
R |
ON |
R |
ONLY |
N |
OPEN |
R |
OPTIMIZE |
N |
OPTION |
R |
OR |
R |
ORDER |
R |
OUT |
N |
OUTER |
R |
OUTPUT |
N |
OVER |
R |
PAGLOCK |
N |
PARTITION |
N |
PATH |
N |
PERCENT_RANK |
N |
PERCENTILE_CONT |
N |
PERCENTILE_DISC |
N |
PHYSICAL |
N |
POOL |
N |
PRIMARY |
R |
PRIMARY_COPY |
N |
PRINT |
R |
PRIOR |
N |
PRIVILEGES |
N |
PROCEDURE |
R |
QUOTEDDEFAULT |
N |
RAISE_ERROR |
R |
RANGE |
N |
RAW |
N |
READCOMMITED |
N |
READCOMMITTEDLOCK |
N |
READONLY |
N |
READPAST |
N |
READUNCOMMITED |
N |
REAL |
N |
REFERENCES |
R |
RELATIVE |
N |
REMOTE |
N |
REMOVE |
N |
REPEATABLEREAD |
N |
REPLICATION |
R |
RETURN |
R |
REVOKE |
R |
RIGHT |
R |
ROLLBACK |
R |
ROW |
N |
ROWCOUNT |
R |
ROWLOCK |
N |
ROWS |
N |
ROWVERSION |
N |
SCHEME |
R |
SECONDARY_COPY |
N |
SELECT |
R |
SERIALIZABLE |
N |
SET |
R |
SETS |
N |
SKIPCACHE |
N |
SMALLDATETIME |
N |
SMALLINT |
N |
SMALLMONEY |
N |
SNAPSHOT |
N |
SOME |
R |
SOURCE |
N |
SPARK_SHUFFLE_PARTITIONS |
N |
SPLIT |
N |
SQL_VARIANT |
N |
STATISTICS |
R |
SWITCH |
N |
TABLE |
R |
TABLOCK |
N |
TABLOCKX |
N |
TARGET |
N |
TEXT |
N |
THEN |
R |
TIME |
N |
TIMESTAMP |
N |
TINYINT |
N |
TO |
R |
TOP |
R |
TRANSACTION |
R |
TRIGGER |
R |
TRUNCATE |
R |
TRY |
N |
UNION |
R |
UNIQUE |
R |
UNIQUEIDENTIFIER |
N |
UNKNOWN |
N |
UPDATE |
R |
UPDLOCK |
N |
USE |
R |
USED |
N |
USING |
N |
VALUES |
R |
VARBINARY |
N |
VARCHAR |
N |
VARYING |
R |
VIEW |
R |
VIEWS |
N |
VIRTUAL |
N |
WAITFOR |
R |
WHEN |
R |
WHERE |
R |
WHILE |
R |
WITH |
R |
XLOCK |
N |
XML |
N |