THE SQL Server Blog Spot on the Web

Welcome to SQLblog.com - The SQL Server blog spot on the web Sign in | |
in Search

Louis Davidson

2008: Error List in 2008

Ok, so I was looking around for a blurb about plan guides for my anti ad hoc SQL section of my book (ok, maybe not completely anti- but that isn't the point,) when I found this blog: http://geekswithblogs.net/Sreeblog/articles/117576.aspx that basically just lists some new features in 2008.  One that I hadn't seen I feel the need to mention. 

Transact-SQL Error List Window:
SQL Server Management Studio includes an Error List window that displays the syntax and semantic errors generated from the IntelliSense code in the Transact-SQL Query Editor.

If you haven't seen this, it is really kind of neat.  Say you type:

select *
from sys.object
whe re name = 'fred'

You can see the obvious errors, since this is a very small batch, but IntelliSense underlines sys.object and re in the batch.  Go to the View menu and show the Error List, and you will see something like this:

image 

Double-click on the error, it takes you to the error in the query window.  Obviously I have just discovered this, so please comment if you know more about this topic (particularly if it has been helpful to you or not) please chime in.  And thanks to Sreenivas Mogullapalli for the cool post, it had a few other things I didn't remember too (just don't make me have to pronounce your name...I am pretty sure I wouldn't get it right.)

Published Wednesday, March 05, 2008 10:40 PM by drsql
Filed under: , ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

Scott R. said:

Louis,

I am encouraged by the new T-SQL IntelliSense highlighting in the SQL 2008 Management Studio query editor.  Like you, I was not aware of the new error list window and its capabilities.

While the T-SQL IntelliSense feature is new in SQL 2008, the error window is not entirely new.  In SQL 2005 Management Studio, when a T-SQL query is run and has errors, there is a Messages tab that lists the errors (similar to the new error list window).  If you double-click on the error message in the Messages tab, the editor window highlights the line of the query flagged in the error.  Even if you don’t run all of the queries in the editor window (by highlighting the desired lines before clicking on Execute), the corresponding error line for the proper query will be highlighted in the query editor window.  Given that the error message may not pinpoint exactly where in the query the specific error was located, the highlighted editor line may or may not pinpoint the exact error – it only highlights the line number as flagged by the error message (accurate or not).

I was not aware of this SQL 2005 feature until recently, when I discovered it by accident!

It will be interesting to see if the error pinpointing accuracy in the new SQL 2008 error list windows is better than the similar Messages tab in SQL 2005 – hopefully so.

Scott R.

March 6, 2008 11:55 AM
 

drsql said:

Cool... Thanks for the tip!  I didn't know that existed either :)

March 7, 2008 9:18 AM
 

Denis Gobo said:

What Scott describes has been available since at least SQL Server 2000. Whenever you double clicked on the error on the message tab it would always bring you to the error line

March 7, 2008 9:23 AM
 

drsql said:

Dennis, you are right.  I misread what he was saying.  I hardly ever use the grids view (unless I have to deal with columns that are sized way too large :) and I thought he meant that there was a different window like this one.  I definitely knew that you could click on the error message in the output in the results.

March 9, 2008 5:25 PM

Leave a Comment

(required) 
(required) 
Submit

This Blog

Syndication

Links to my other sites

Powered by Community Server (Commercial Edition), by Telligent Systems
  Privacy Statement