Is it possible to determine if any string is a SQL Server Reserved keywords or not?
Logic should like -
IF @string is SQL Server Reserved Keywords
RETURN 1
ELSE
RETURN 0
As far as I know there is no built-in way. You can write your own function that would compare the string against known reserved words from documentation.
This list can be kept dynamic in a table so as it changes (e.g. for different versions of SQL Server) the table can be updated.
Also this way a single SELECT statement will yield the result.
You could make a table containing keywords. A list can be found here: http://msdn.microsoft.com/en-us/library/ms189822.aspx
Then you can use a join with where to determine if a string is reserved.
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