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.

1 Answer 1

5

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...

Sign up to request clarification or add additional context in comments.

1 Comment

+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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.