Feature Request...variable casing consistency...

Refactors and formats SQL code.

Feature Request...variable casing consistency...

Postby swjohnson » Fri Jan 19, 2007 10:35 pm

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.


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


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


Posts: 20
Joined: Mon Jul 18, 2005 4:16 pm
Location: Lincoln, NE USA

Postby Brian Donahue » Tue Jan 23, 2007 4:55 pm

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.
Brian Donahue
Posts: 6590
Joined: Mon Aug 23, 2004 9:48 am

Postby darren » Thu Apr 02, 2009 3:44 pm

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!
Posts: 1
Joined: Thu Apr 02, 2009 3:34 pm

Return to SQL Refactor Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests