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 12345»»»

Expressions Expand / Collapse
Author
Message
Posted Wednesday, August 7, 2013 9:21 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 6:02 PM
Points: 1,964, Visits: 6,603
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
  • Post #1482119
    Posted Wednesday, August 7, 2013 9:25 PM
    Valued Member

    Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

    Group: General Forum Members
    Last Login: Wednesday, June 24, 2015 3:58 PM
    Points: 66, Visits: 104
    Moral of today's question. Be careful when using indeterministic functions inside nullif...
    Post #1482120
    Posted Wednesday, August 7, 2013 11:30 PM


    Ten Centuries

    Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

    Group: General Forum Members
    Last Login: Thursday, February 6, 2014 4:15 AM
    Points: 1,242, Visits: 1,546
    i have taken more time to answer this and learn something new.

    Thanks MM




    Thanks
    Vinay Kumar
    -----------------------------------------------------------------
    Keep Learning - Keep Growing !!!
    www.GrowWithSql.com

    Post #1482139
    Posted Wednesday, August 7, 2013 11:58 PM


    SSChampion

    SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

    Group: General Forum Members
    Last Login: Today @ 7:12 AM
    Points: 14,467, Visits: 12,458
    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 LessThanDot.

    MCSA SQL Server 2012 - MCSE Business Intelligence
    Post #1482144
    Posted Thursday, August 8, 2013 12:14 AM
    SSCrazy

    SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

    Group: General Forum Members
    Last Login: Thursday, January 22, 2015 2:37 AM
    Points: 2,624, Visits: 587
    Nice "tricky" question! Thank you!

    /Håkan Winther
    MCITP:Database Developer 2008
    MCTS: SQL Server 2008, Implementation and Maintenance
    MCSE: Data Platform
    Post #1482150
    Posted Thursday, August 8, 2013 1:07 AM


    SSCrazy

    SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

    Group: General Forum Members
    Last Login: Yesterday @ 5:32 AM
    Points: 2,046, Visits: 2,555
    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/
    Post #1482160
    Posted Thursday, August 8, 2013 1:12 AM
    Ten Centuries

    Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

    Group: General Forum Members
    Last Login: Yesterday @ 4:46 PM
    Points: 1,193, Visits: 3,237
    Nice question thanks
    Post #1482162
    Posted Thursday, August 8, 2013 1:59 AM
    Grasshopper

    GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

    Group: General Forum Members
    Last Login: Monday, June 22, 2015 5:47 AM
    Points: 21, Visits: 59
    How about
    newid() = '00000000-0000-0000-0000-000000000000'

    The question is not correct. Answer is 0 (zero).
    Post #1482172
    Posted Thursday, August 8, 2013 2:21 AM


    SSCrazy

    SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

    Group: General Forum Members
    Last Login: Today @ 2:00 AM
    Points: 2,863, Visits: 2,733
    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

    Post #1482182
    Posted Thursday, August 8, 2013 2:26 AM
    SSCommitted

    SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

    Group: General Forum Members
    Last Login: Today @ 8:26 AM
    Points: 1,719, Visits: 5,896
    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?
    Post #1482183
    « Prev Topic | Next Topic »

    Add to briefcase 12345»»»

    Permissions Expand / Collapse