August 7, 2013 at 9:21 pm
Comments posted to this topic are about the item Expressions
MM
select geometry::STGeomFromWKB(0x0106000000020000000103000000010000000B0000001000000000000840000000000000003DD8CCCCCCCCCC0840000000000000003DD8CCCCCCCCCC08408014AE47E17AFC3F040000000000104000CDCCCCCCCCEC3F9C999999999913408014AE47E17AFC3F9C99999999991340000000000000003D0000000000001440000000000000003D000000000000144000000000000000400400000000001040000000000000F03F100000000000084000000000000000401000000000000840000000000000003D0103000000010000000B000000000000000000143D000000000000003D009E99999999B93F000000000000003D009E99999999B93F8014AE47E17AFC3F400000000000F03F00CDCCCCCCCCEC3FA06666666666FE3F8014AE47E17AFC3FA06666666666FE3F000000000000003D1800000000000040000000000000003D18000000000000400000000000000040400000000000F03F000000000000F03F000000000000143D0000000000000040000000000000143D000000000000003D, 0);
August 7, 2013 at 9:25 pm
Moral of today's question. Be careful when using indeterministic functions inside nullif...
August 7, 2013 at 11:30 pm
:Whistling: i have taken more time to answer this and learn something new.
Thanks MM
Thanks
Vinay Kumar
-----------------------------------------------------------------
Keep Learning - Keep Growing !!!
August 7, 2013 at 11:58 pm
Very nice question. Thanks.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
August 8, 2013 at 12:14 am
Nice "tricky" question! Thank you!
/Hรฅkan Winther
MCITP:Database Developer 2008
MCTS: SQL Server 2008, Implementation and Maintenance
MCSE: Data Platform
August 8, 2013 at 1:07 am
Koen Verbeeck (8/7/2013)
Very nice question. Thanks.
+1 ๐
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
August 8, 2013 at 1:12 am
Nice question thanks
August 8, 2013 at 1:59 am
How about
newid() = '00000000-0000-0000-0000-000000000000'
The question is not correct. Answer is 0 (zero).
August 8, 2013 at 2:21 am
Very good explanation!
Here is why the first select may return 1,-1,negative and the second only 1 and negative.
The same side effect of "C" macros:
#define abs(a) (a < 0? a*-1: a )
int a = 1;
print("Result %d",abs(++a));
Result 3
select
isnull(
nullif( convert( varchar, sign( checksum( upper(newid()) ) ) ), '-1' )
, 'negative'
)
declare @U uniqueidentifier = newid()
select
isnull(
nullif( convert( varchar, sign( checksum( @U ) ) ), '-1' )
, 'negative'
)
go 10
August 8, 2013 at 2:26 am
ok181ko (8/8/2013)
How aboutnewid() = '00000000-0000-0000-0000-000000000000'
The question is not correct. Answer is 0 (zero).
The question asked which of the answers were possible outputs of the statement. It never stated that *all* of the possible outputs were listed as answers. Plus, is it even possible for NEWID() to return a value that's all zeroes?
August 8, 2013 at 2:26 am
Definitely learnt something new today! Was very confused at first but a great explanation too - makes it simple. - Thanks.
August 8, 2013 at 2:44 am
This was removed by the editor as SPAM
August 8, 2013 at 4:20 am
Dang It! Did it again. I did NOT get my coffee before answering the question. Thus, missed it again. Good question.
August 8, 2013 at 4:21 am
Good question!
*kicks self* - I knew this, have been bitten by it before, and STILL managed to get it wrong. Obviously need to be bittenn a lot more before it finally sinks in enough that I don't forget about it anymore... ๐
August 8, 2013 at 4:31 am
Nice question, definitely learned something new.
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537Viewing 15 posts - 1 through 15 (of 50 total)
You must be logged in to reply to this topic. Login to reply