Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Case sensitivity when declaring paramters Expand / Collapse
Author
Message
Posted Sunday, January 27, 2013 5:09 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, February 06, 2014 4:58 AM
Points: 225, Visits: 127
My server is case sensitive (CS)
My DataBase is no (CI)


The smss query editor works fine for this kind of query


CREATE TABLE [dbo].[Table_Test](
[col1] [int] NULL,
[Col2] [int] NULL
) ON [PRIMARY]

--- pay attention to columns names (col1,Col2)

Declare @col1value int

set @col1value = 15

insert table_test (Col1,col2) values (@col1value ,10)

-- This works although the table name and the columns name are in different case

-- But when I am changing the Declare to Declare @Col1value int


it reports an error

Does the collation for the t-sql parameters defined by the server collation ? or it is defined in the T-SQL lanquege core





Post #1412116
Posted Sunday, January 27, 2013 8:04 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, February 06, 2014 4:58 AM
Points: 225, Visits: 127
well i have Installed Case Insensitive Instance on my machine

The paramter declareatiom is infulanced by the server collation

Case Insensitive Server Collation :

Declare @Col1 int
Set @col1 =16

works

on

Case sensitive Server Collation (DataBase Case Insensitive)

Declare @Col1 int
Set @col1 =16

Does not work


Conclusion

Paramters are sensitive only to the server collation



Post #1412129
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse