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

More Conversion Fun Expand / Collapse
Author
Message
Posted Monday, March 16, 2009 9:25 PM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Saturday, July 19, 2014 6:50 AM
Points: 540, Visits: 254
Comments posted to this topic are about the item More Conversion Fun
Post #677141
Posted Tuesday, March 17, 2009 3:13 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 3:16 PM
Points: 2,548, Visits: 542
Someone may think this is a feature, but i think it is sad that SQL doesnt handle this as an error due to the fact that it is to easy skip optional parameters/statements, and some people does not have the fully understanding of why it is sometime very important. This laziness may lead to bugs.

My recommendation is to never skip optional parameters or statements. It tends to be more code to write, but it is more secure.

/Håkan Winther
Senior Development DBA


/Håkan Winther
MCITP:Database Developer 2008
MCTS: SQL Server 2008, Implementation and Maintenance
MCSE: Data Platform
Post #677279
Posted Tuesday, March 17, 2009 3:19 AM
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: Sunday, July 13, 2014 8:35 AM
Points: 3,937, Visits: 1,087
Maybe the second alternative should have been "S"? "T" really doesn't make any sense at all. It really doesn't matter though, it's wrong anyway :)

Lars Broberg
Elbe-Data AB
Post #677287
Posted Tuesday, March 17, 2009 7:19 AM
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: Tuesday, September 2, 2014 8:36 AM
Points: 3,918, Visits: 3,638
Yes I agree. When "S" wasn't there I went looking for the correct answer.
Post #677413
Posted Tuesday, March 17, 2009 8:35 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Today @ 12:38 AM
Points: 33,267, Visits: 15,436
I changed the wrong answer to "S". Didn't notice that one before :)







Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #677517
Posted Tuesday, March 17, 2009 9:04 AM
Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Friday, September 12, 2014 3:01 PM
Points: 683, Visits: 191
My only question is why I thought that when n wasn't specified in a cast/convert it was 50... good thing I never leave out those pesky optional variables in production code!
Post #677563
Posted Tuesday, March 17, 2009 9:31 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Tuesday, December 7, 2010 8:13 AM
Points: 436, Visits: 322
I wonder why 30?
Post #677605
Posted Tuesday, March 17, 2009 10:10 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Thursday, August 28, 2014 8:53 PM
Points: 1,521, Visits: 3,039
So maybe if the second choice had still been "T", I would have picked another response. I am puzzled how I hadn't seen the default length of 30 before, yet the great majority of over 800 respondents to this QOD got it right. Oh, well. One more poke in the ribs that I've still got lots to learn.

Of course I agree with others that it would be better not to depend on a default value, especially one as seemingly capricious as this one. Come to think of it, 30 makes some sense -- 30 characters and two more to hold the "real" length make 32, a power of two (just a guess).
Post #677652
Posted Tuesday, March 17, 2009 11:57 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Tuesday, December 7, 2010 8:13 AM
Points: 436, Visits: 322
Come to think of it, 30 makes some sense -- 30 characters and two more to hold the "real" length make 32, a power of two (just a guess).

How much space does a char take? 8*32 = 256
Post #677757
Posted Wednesday, March 18, 2009 6:48 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Today @ 10:02 AM
Points: 519, Visits: 2,816
[b]I am puzzled how I hadn't seen the default length of 30 before, yet the great majority of over 800 respondents to this QOD got it right.


Some of us learned this the hard way.



Post #678367
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse