Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Expressions


Expressions

Author
Message
mister.magoo
mister.magoo
SSCrazy
SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)

Group: General Forum Members
Points: 2266 Visits: 7824
Comments posted to this topic are about the item Expressions

MM


select geometry::STGeomFromWKB(0x0106000000020000000103000000010000000B0000001000000000000840000000000000003DD8CCCCCCCCCC0840000000000000003DD8CCCCCCCCCC08408014AE47E17AFC3F040000000000104000CDCCCCCCCCEC3F9C999999999913408014AE47E17AFC3F9C99999999991340000000000000003D0000000000001440000000000000003D000000000000144000000000000000400400000000001040000000000000F03F100000000000084000000000000000401000000000000840000000000000003D0103000000010000000B000000000000000000143D000000000000003D009E99999999B93F000000000000003D009E99999999B93F8014AE47E17AFC3F400000000000F03F00CDCCCCCCCCEC3FA06666666666FE3F8014AE47E17AFC3FA06666666666FE3F000000000000003D1800000000000040000000000000003D18000000000000400000000000000040400000000000F03F000000000000F03F000000000000143D0000000000000040000000000000143D000000000000003D, 0);




  • Forum Etiquette: How to post Reporting Services problems
  • Forum Etiquette: How to post data/code on a forum to get the best help - by Jeff Moden
  • How to Post Performance Problems - by Gail Shaw

  • james.of.rivendell
    james.of.rivendell
    SSC Journeyman
    SSC Journeyman (86 reputation)SSC Journeyman (86 reputation)SSC Journeyman (86 reputation)SSC Journeyman (86 reputation)SSC Journeyman (86 reputation)SSC Journeyman (86 reputation)SSC Journeyman (86 reputation)SSC Journeyman (86 reputation)

    Group: General Forum Members
    Points: 86 Visits: 126
    Moral of today's question. Be careful when using indeterministic functions inside nullif...
    Danny Ocean
    Danny Ocean
    Ten Centuries
    Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

    Group: General Forum Members
    Points: 1348 Visits: 1549
    Whistling i have taken more time to answer this and learn something new.

    Thanks MM

    Thanks
    Vinay Kumar
    -----------------------------------------------------------------
    Keep Learning - Keep Growing !!!
    www.GrowWithSql.com
    Koen Verbeeck
    Koen Verbeeck
    SSCoach
    SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)

    Group: General Forum Members
    Points: 16441 Visits: 13202
    Very nice question. Thanks.



    How to post forum questions.
    Need an answer? No, you need a question.
    What’s the deal with Excel & SSIS?

    Member of LinkedIn. My blog at SQLKover.

    MCSA SQL Server 2012 - MCSE Business Intelligence
    hakan.winther
    hakan.winther
    SSCrazy
    SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)

    Group: General Forum Members
    Points: 2702 Visits: 601
    Nice "tricky" question! Thank you!

    /Håkan Winther
    MCITPBigGrinatabase Developer 2008
    MCTS: SQL Server 2008, Implementation and Maintenance
    MCSE: Data Platform
    kapil_kk
    kapil_kk
    SSCrazy
    SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)

    Group: General Forum Members
    Points: 2417 Visits: 2763
    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/
    mickyT
    mickyT
    Ten Centuries
    Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

    Group: General Forum Members
    Points: 1253 Visits: 3309
    Nice question thanks
    ok181ko
    ok181ko
    Grasshopper
    Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)

    Group: General Forum Members
    Points: 23 Visits: 65
    How about
    newid() = '00000000-0000-0000-0000-000000000000'

    The question is not correct. Answer is 0 (zero).
    Carlo Romagnano
    Carlo Romagnano
    Hall of Fame
    Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)

    Group: General Forum Members
    Points: 3600 Visits: 3233
    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


    paul.knibbs
    paul.knibbs
    SSCommitted
    SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)

    Group: General Forum Members
    Points: 1972 Visits: 6213
    ok181ko (8/8/2013)
    How about
    newid() = '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?
    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