Monday, December 21, 2009

TSD03006 warnings in GDR2 Database Projects

At work we do a lot of Database development using Microsoft Visual Studio 2008 Team Suite, a component of which is the Database Edition. We have upgraded our database edition to the GDR2 release and it works great...mostly.

Occasionally, in database solutions that have multiple database projects that include views that reference one of the other databases in the solution, we get lots of TSD03006 errors and warnings like the following;

TSD03006: View: [dbo].[ViewName] has an unresolved reference to object [dbo].[Table]

The thing is, the database reference exists correctly and the reference variables work fine for every other type of object, just not these views. This is something that was a known problem but was fixed in GDR2...except it still didn't work for us. None of the other suggestions I came across in my research worked, like deleting the .dbmdl file.

For us it turned out to be a very hard to find problem with the database project collation. One of my co-workers, Phil, tracked it down as he was getting better warning messages from our build server than from Visual Studio that helped him target the culprit.

If you open the .sqlsettings property file for your project, you define the project collation via a combo box like the following;

You can see that this has a Case Insensitive collation. Phil then went as far as manually opening the underlying .sqlsettings file that this project property page uses, only to find the following;

What the...?

The underlying .sqlsettings file had the database collation as a Case Sensitive collation which would cause references to not be found if there was the slightest change in case between the target object and the referencing view. I don't know why the Visual Studio User Interface was not getting the collation value correctly but by manually editing the .sqlsettings file back to the Case Insensitive collation, all the TSD03006 reference errors disappeared.

This has been very hard to reproduce, and once you have manually updated the .sqlsettings file the setting is correctly represented within the Visual Studio User Interface. We think it may be an issue that occured when our previous database projects were upgraded straight to GDR2, bypassing the first GDR upgrade.

Hope this helps some other folks out.

Wednesday, December 02, 2009

24 Hours of SQL PASS: The sessions are now available for viewing

I represented the Canberra SQL Server User Group by moderating one of the SQL 24 hours of PASS sessions back on 2009-09-02.

The session I moderated was called Text Mining and was presented by Dejan Sarka. It was a lot of fun and thankfully there were no technical issues.

This and the other 23 session recordings are available at: http://24hours.sqlpass.org/sessions.aspx
Wider Two Column Modification courtesy of The Blogger Guide