|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Yesterday @ 6:46 AM
Points: 1,074,
Visits: 1,130
|
|
|
|
|
|
SSCrazy Eights
        
Group: General Forum Members
Last Login: Yesterday @ 6:54 AM
Points: 9,364,
Visits: 6,462
|
|
Euh... wut? Is it me and I'm going blind, but aren't the first and the second answer exactly the same? The second and the third resultset are just swapped around (and why would you do that?)
Why put the third resultset before the second resultset in 3 of the 4 answers?
And the explanation doesn't mention why inserting NULL in another string doesn't result in NULL, but in an empty space instead.
But thanks for the effort
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
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Wednesday, May 15, 2013 8:02 PM
Points: 2,855,
Visits: 404
|
|
Thanks for the question. interesting to know the null is treated differently in the function.
In regards to answer A and B being the same, I think it's because of copy and paste and forgetting to swap the numbering. I decided to go for the order as it appears and got it right
Urbis, an urban transformation company
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Wednesday, May 15, 2013 6:23 AM
Points: 923,
Visits: 995
|
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Yesterday @ 2:04 AM
Points: 1,968,
Visits: 1,819
|
|
Koen Verbeeck (5/16/2011) And the explanation doesn't mention why inserting NULL in another string doesn't result in NULL, but in an empty space instead.
I am curious: bol does not mention the case the last parameter is NULL. Maybe a BUG?
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: 2 days ago @ 3:34 PM
Points: 2,170,
Visits: 3,582
|
|
Thanks for the question
Mohammed Moinudheen
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Yesterday @ 4:24 AM
Points: 1,158,
Visits: 642
|
|
| ... made easier by the strange set of answers.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Yesterday @ 9:52 AM
Points: 1,356,
Visits: 4,761
|
|
Koen Verbeeck (5/16/2011) And the explanation doesn't mention why inserting NULL in another string doesn't result in NULL, but in an empty space instead.
That's what got me. Surely it's a bug? select 'Vinay, ' + NULL + ', Amit' returns NULL, so I'd have thought select STUFF('Vinay, Vijay, Amit',8,5,NULL) should do the same?
|
|
|
|
|
SSCrazy Eights
        
Group: General Forum Members
Last Login: Yesterday @ 6:54 AM
Points: 9,364,
Visits: 6,462
|
|
|
|
|
|
Mr or Mrs. 500
      
Group: General Forum Members
Last Login: 2 days ago @ 9:12 AM
Points: 557,
Visits: 1,356
|
|
Koen Verbeeck (5/16/2011)
Euh... wut? Is it me and I'm going blind, but aren't the first and the second answer exactly the same? The second and the third resultset are just swapped around (and why would you do that?) Why put the third resultset before the second resultset in 3 of the 4 answers? And the explanation doesn't mention why inserting NULL in another string doesn't result in NULL, but in an empty space instead. But thanks for the effort 
My thoughts exactly. I just went for the answers that were in the correct order.
|
|
|
|