Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Case sensitivity within stored procedure

Author  Topic 

Dvlpr2878
Starting Member

2 Posts

Posted - 2010-05-05 : 17:11:40
Howdy,

I am working with a server with the collation set to SQL_Latin1_General_CP1_CS_AS . While creating an index on a new table in a new database, the SQL script was case sensitive (the table has a column iCustomer number and the script failed trying to index the column icustomer). I deleted the database and created a new database using SQL_Latin1_General_CP1_CI_AS as the collation and that script worked. Now however another script is attempting to create a stored procedure, however it is declaring a variable @iCustomer and attempts to use the variable as @icustomer and fails. The same scripts have worked on many (>20) SQL servers so I know the scripts work. This is the first SQL server with a collation other than SQL_Latin1_General_CP1_CI_AS. Any ideas?

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-05-06 : 13:07:55
is script overriding default collation of the db?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

Dvlpr2878
Starting Member

2 Posts

Posted - 2010-05-07 : 09:04:47
No. Do declared variables use the server's collation? That's the only thing I can think of since the database is case insensitive and the server is case sensitive
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-05-07 : 09:32:56
" the server is case sensitive"

and presumably TEMPDB will be case sensitive too ... so any @TableVar or #TempTable you create you will need to eplicitly set the Collation on all Varchar/etc columns

Not come across that on variable names, but maybe something is doing something related in TEMPDB?
Go to Top of Page
   

- Advertisement -