Sumafu Sumafu - 1 year ago 81
SQL Question

Strange SQL-Statement

I just found an SQL-Statement with a syntax I never seen before. And I found nothing in the internet about this syntax. Does anybody knows what [field] means?

SELECT 'Customer' AS Tablename
, [Ct_ID] AS ID
, [Ct_Name] AS Name
FROM Customer

Answer Source

In MS TransactSQL (aka SQL Server), square brackets are used around field names that would otherwise not be valid (reserved words, names with spaces or other special characters).

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download