January 2009 - Posts

One of the thinks I like about working with SQL Server is that there's always something new to learn. Sometimes, as in this case it doesn't have much of a practical benefit. Whilst running a trace on a database application to troubleshoot why it wasn't working properly I noticed a query that looked a little odd. It had spaces between the user and object name in the from clause (it was a SQL 2000 instance hence user rather than schema) e.g. it had a query that looked something like the picture below

This parses and executes absoloutely fine so I wondered what would happen if I increased the amount of whitespace as shown below

Again this works fine and as demonstrated below you can even separate all the parts of the from clause across multiple lines.

As I said, not much practical use - I'm not sure how they even managed to end up writing an application that generate this T-SQL!

Posted by sqldbatips | 1 comment(s)
Filed under: