Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have Visual Studio 2010 SP1 with SSDT (with Dec 2012 update). I have created a new SQL Server project and imported objects from a database on a SQL Server 2008 R2 instance. The database has a compatibility mode of 80, can't change this at the time.

Anyway. When I do a build, which has to be clean in order for me to do a schema compare, it is throwing SQL70590 errors on the variables although SQL Server itself has no problem with them. Looking at them it seems it is because of the case sensitivity of the variable (e.g. declared as @VARIABLE but referenced as @Variable).

The database collation is set to Latin1_General_BIN, is this why the error is being thrown? I can't see why it sees it as an error yet the procedure code runs without error on the database.

share|improve this question
    
I don't have a project handy to test with, but isn't that something you can suppress on the Build tab? i.stack.imgur.com/1Vv3q.png –  billinkc Feb 7 '13 at 16:16
    
Variables is case sensitive if the server collation is case sensitive. You can check the server collation with SELECT SERVERPROPERTY ('Collation'). –  Mikael Eriksson Feb 7 '13 at 16:19
    
@billinkc you can only suppress warnings. –  Shawn Melton Feb 7 '13 at 16:34
    
@MikaelEriksson Server collation is set to SQL_Latin1_General_CP1_CI_AS. –  Shawn Melton Feb 7 '13 at 16:40
2  
Why not fix the issues that it highlights? If the code is ever deployed on a CS server it will work correctly and I don't see any positives to referencing the same variable as @VARIABLE and @Variable inconsistently. –  Martin Smith Feb 7 '13 at 17:10
show 1 more comment

2 Answers

Try adding this to a PropertyGroup in the .sqlproj file directly:

<ModelCollation>1033,CI</ModelCollation>

I had a similar issue when was migrating a .dbproj to a .sqlproj. I had this suggested to me by our team's dba, I don't know exactly what this does..

share|improve this answer
add comment
up vote 0 down vote accepted

I ended up changing around how I am going to use SSDT with this database project. In the end I will be fixing all the issues with case sensitivity on the stored procedures. The caveat to my project is I do not know all the objects that are actually being used in the application, so I only care about those objects actually being used. I am simply starting with an empty database project and adding in the objects the developers are going to be using in the application as they redesign it. I should then have a database project with "clean" objects in order to do a schema compare.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.