I would like to know what special characters are allowed to be used in column name in T-SQL, MSSQL. So I know I can use letters and numbers, but are the other characters that are available without using brackets [] to refer to this column?
from MSDN:
The first character must be one of the following:
Subsequent characters can include the following:
The identifier must not be a Transact-SQL reserved word. SQL Server reserves both the uppercase and lowercase versions of reserved words.
Embedded spaces or special characters are not allowed.
Supplementary characters are not allowed.
edit
refering to NinthSense: the specs also says:
Certain symbols at the beginning of an identifier have special meaning in SQL Server. A regular identifier that starts with the at sign always denotes a local variable or parameter and cannot be used as the name of any other type of object.
and this statement can be executed without errors:
create table #t (
#oid int ,
äß int,
ßdid varchar(10),
_data varchar(10)
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With