Feature Request...variable casing consistency...

swjohnsonswjohnson Posts: 30
This is from my programming background and variable consistency.

I see alot of my VB programmers code this @myString in one place and @MySTring in another and from my background this is two different variables.

Something to make all the variables consistent with the casing of DECLARE statement.

So

DECLARE @myString varchar(250)
SET @MYString ='This is annoying to me'
Exec 'Select.....' + @mySTRING + ' from tblRater'

to

DECLARE @myString varchar(250)
SET @myString ='This is annoying to me'
Exec 'Select.....' + @myString + ' from tblRater'

Thanks!

SJ

Comments

  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hi SJ,

    Thanks for writing. We could consider this as an additional option, but for the sake of accuracy, SQL Server, when using the default collation order, considers @myString and @MyString as the same variable. If the server was using a case-sensitive collation, these would be considered two distinct variables.
  • Can this be revisited as an optional feature in SQL Refactor? Having the option to make variable names conform to a standard is something that would benefit me greatly. Yes, there is the issue of working on a CS server, but I don't think it's good practice to differentiate variables solely on case!
Sign In or Register to comment.