There is a table with a column name PERCENT
. I need to run an ordinary SELECT
query:
SELECT *
FROM <my_table>
WHERE PERCENT = 100
However, I get this error message:
Msg 156, Level 15, State 1, Line 2
Incorrect syntax near the keyword 'PERCENT'
Is there a way to indicate a column so the system accepts it as a column name instead of a function?
PERCENT
is a reserved word. Use escape characters:
SELECT *
FROM <my_table>
WHERE [PERCENT] = 100
It is used, for instance, with TOP
as in TOP 100 PERCENT
.
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