Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

What is this? Expand / Collapse
Author
Message
Posted Wednesday, May 26, 2010 9:16 AM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Friday, October 17, 2014 8:13 AM
Points: 9,926, Visits: 11,188
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
SQL Server MVP
SQLblog.com
@SQL_Kiwi
Post #928370
Posted Wednesday, May 26, 2010 12:11 PM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Friday, May 9, 2014 12:47 AM
Points: 3,448, Visits: 4,407
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::Parse('MULTILINESTRING((0 1, 0 0, 1 0, 0 1), (1 1, 1 0))');
DECLARE @g2 GEOMETRY = GEOMETRY::Parse('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.
Post #928509
Posted Wednesday, May 26, 2010 12:22 PM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Friday, October 17, 2014 8:13 AM
Points: 9,926, Visits: 11,188
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
SQL Server MVP
SQLblog.com
@SQL_Kiwi
Post #928520
Posted Wednesday, May 26, 2010 12:56 PM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Friday, May 9, 2014 12:47 AM
Points: 3,448, Visits: 4,407
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!


It's always useful to know how those C# developers use our database stuff
Post #928553
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse