Created
January 9, 2017 11:06
-
-
Save dazzag24/f9863e12d1230b8caa9849703b8f7cf7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If you have a column named Key then you will have issues when doing this: | |
select * from Sectors where Key = 'bagder' | |
"Incorrect syntax near the keyword 'Key'." | |
This is because Key is a reserved keyword in SQL. To resolve this, simply place the column name in square brackets e.g. | |
select * from Sectors where [Key] = 'bagder' | |
For in more complex examples: | |
select Email, Name from People P inner join Sectors S ON J.Sectorkey = S.[Key]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment