Case sensitivity when declaring paramters

  • 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

  • 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

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply