SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


What is this?


What is this?

Author
Message
Paul White
Paul White
SSCoach
SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)

Group: General Forum Members
Points: 15568 Visits: 11355
vk-kirov (5/26/2010)
Paul White NZ (3/30/2010)
It seems odd to me that type names must be lower cased in a case-sensitive database.

It's not true (or I don't understand what you mean).

I was referring to Oleg's post. Perhaps the reason it struck me as odd is because it isn't true, as you point out :-)
My point about hierarchyid is valid though:


DECLARE @A HIERARCHYID;
SET @A = hierarchyid::GetRoot();
SET @A = HIERARCHYID::GetRoot();


The second SET statement will not compile in a case-sensitive database. (I don't mind too much, since it is a method call but still...)

The names of system data types (except 'sysname') may be written in whatever case you want. The names of user data types (plus 'sysname') must be written in the same case as they are defined in the database.

That's odd too. For me, DECLARE @B sYsNaMe; works just fine in a case-sensitive collation (SQL Server 10.0.2775 Dev x86).

Paul White NZ (3/30/2010)
Am I the only one that prefers to upper case my types?

It depends on what you call 'my types' :-) For 'standard data types in my code', I prefer upper case (INT, VARCHAR, SYSNAME etc.). For 'data types defined by me' (which is equivalent to 'CLR data types' in my case), I prefer Pascal case (ParameterSet, VarArray etc.).

I was referring to T-SQL types and aliases, yes. I use camelCase or PascalCase in C# depending on scope.

Paul



Paul White
SQLPerformance.com
SQLblog.com
@SQL_Kiwi
vk-kirov
vk-kirov
Hall of Fame
Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)

Group: General Forum Members
Points: 3698 Visits: 4408
Paul White NZ (5/26/2010)
For me, DECLARE @B sYsNaMe; works just fine in a case-sensitive collation (SQL Server 10.0.2775 Dev x86).

Hmmm... Microsoft changed it in SQL Server 2008. In SQL 2005, 'DECLARE @B sYsNaMe' produces an error. Well, SQL 2008 became more consistent here.

Paul White NZ (5/26/2010)
vk-kirov (5/26/2010)
Paul White NZ (3/30/2010)
It seems odd to me that type names must be lower cased in a case-sensitive database.

It's not true (or I don't understand what you mean).

I was referring to Oleg's post. Perhaps the reason it struck me as odd is because it isn't true, as you point out :-)

Oleg said about sysname only, and it was true for SQL 2005 :-)

Paul White NZ (5/26/2010)
My point about hierarchyid is valid though

The same is true for geometry and geography:
DECLARE @g1 GEOMETRY = geometry:Tonguearse('MULTILINESTRING((0 1, 0 0, 1 0, 0 1), (1 1, 1 0))');
DECLARE @g2 GEOMETRY = GEOMETRY:Tonguearse('MULTILINESTRING((0 1, 0 0, 1 0, 0 1), (1 1, 1 0))');

DECLARE @g3 GEOGRAPHY = geography::STGeomFromText('LINESTRING(47 -12, 47 -22)', 4326)
DECLARE @g4 GEOGRAPHY = GEOGRAPHY::STGeomFromText('LINESTRING(47 -12, 47 -22)', 4326)



Paul White NZ (5/26/2010)
I was referring to T-SQL types and aliases, yes. I use camelCase or PascalCase in C# depending on scope.

Sorry for the confusion, I was saying about 'CLR data types used in T-SQL code' (my specific case) :-)
I hope all C# developers use camel case and pascal case as it is a Microsoft standard.
Paul White
Paul White
SSCoach
SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)

Group: General Forum Members
Points: 15568 Visits: 11355
vk-kirov (5/26/2010)
Hmmm... Microsoft changed it in SQL Server 2008. In SQL 2005, 'DECLARE @B sYsNaMe' produces an error. Well, SQL 2008 became more consistent here.

I didn't know that - I didn't bother testing it on my 2005 installation.
Would make a tricky QotD.

The same is true for geometry and geography

On reflection, I think I prefer lower case for these method calls. What do you think?

I hope all C# developers use camel case and pascal case as it is a Microsoft standard.

Yikes! I didn't mean to suggest that I'm a C# developer - not by a long chalk!



Paul White
SQLPerformance.com
SQLblog.com
@SQL_Kiwi
vk-kirov
vk-kirov
Hall of Fame
Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)

Group: General Forum Members
Points: 3698 Visits: 4408
Paul White NZ (5/26/2010)

The same is true for geometry and geography

On reflection, I think I prefer lower case for these method calls. What do you think?

I like to upper-case all blue keywords in SSMS. Geometry and geography are 'blue', so if I should use them in a case sensitive database, it will be an unsolvable problem to me :-)

Paul White NZ (5/26/2010)
I hope all C# developers use camel case and pascal case as it is a Microsoft standard.

Yikes! I didn't mean to suggest that I'm a C# developer - not by a long chalk!

Laugh
It's always useful to know how those C# developers use our database stuff :-)
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search