Feature Request...variable casing consistency...

Refactors and formats SQL code.

Moderators: Chris Auckland, David Atkinson, Anu Deshpande, Luke Jefferson

Feature Request...variable casing consistency...

Postby swjohnson » Fri Jan 19, 2007 11: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.

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
swjohnson
 
Posts: 20
Joined: Mon Jul 18, 2005 5:16 pm
Location: Lincoln, NE USA

Postby Brian Donahue » Tue Jan 23, 2007 5: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: 6669
Joined: Mon Aug 23, 2004 10:48 am

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


Return to SQL Refactor 1

Who is online

Users browsing this forum: No registered users and 0 guests