I am currently using SQL Server Management Studio (Ver 9.00.3042.00) and click the ‘New Query’ and wrote the following code:
Select colA, colB, colC colD From table1
When I click the parse (checkbox) button to validate the SQL statement, it says ‘Command(s) completed successfully’. Isn’t the parse button suppose to catch these simple errors…
Has anyone experienced this type of behavior from Management Studio? This just started happening this week….
That’s because that is valid SQL. You’re effectively aliasing colC with the name colD. It’s the same as typing:
Edit: For what it’s worth, this is one of the reasons why people will argue that you should put the commas at the beginning of the line in cases like this. It’s a lot easier to spot gotchas like this when the code is formatted as such: