March 16, 2009 at 9:25 pm
Comments posted to this topic are about the item More Conversion Fun
March 17, 2009 at 3:13 am
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
March 17, 2009 at 3:19 am
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
March 17, 2009 at 7:19 am
Yes I agree. When "S" wasn't there I went looking for the correct answer.
March 17, 2009 at 8:35 am
I changed the wrong answer to "S". Didn't notice that one before 🙂
March 17, 2009 at 9:04 am
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!
March 17, 2009 at 9:31 am
I wonder why 30?
March 17, 2009 at 10:10 am
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).
March 17, 2009 at 11:57 am
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
March 18, 2009 at 6:48 am
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. :Whistling:
Viewing 10 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply