views:

25

answers:

1

I found problem when trying to retrieve specific name column that using syntax/statement/command using sql.

Example I have table 'dcparam' with name some column 'SELECT', 'INSERT', 'UPDATE' in database sqlserver. Then I trying to select using query:

SELECT SELECT,INSERT,UPDATE FROM dcparam

Well it could be solve using "*" in select, but then how if i wish only specific column.

Regard.

+5  A: 

Add square brackets around the column name.

SELECT [SELECT], [INSERT], [UPDATE] FROM dcparam

It's probably best to reconsider your column names in the long run however...

Jaymz
+1: Agreed. And to re-iterate the posters comment for additional emphasis, you really must look to remove the use of reserved keywords as column names.
John Sansom