Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 1234»»»

STUFF - 2 Expand / Collapse
Author
Message
Posted Saturday, December 8, 2012 11:15 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Sunday, January 4, 2015 7:55 AM
Points: 5,333, Visits: 25,280
Comments posted to this topic are about the item STUFF - 2

If everything seems to be going well, you have obviously overlooked something.

Ron

Please help us, help you -before posting a question please read

Before posting a performance problem please read
Post #1394346
Posted Monday, December 10, 2012 12:11 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Wednesday, May 11, 2016 7:35 AM
Points: 1,378, Visits: 1,579
Thank you for another good question Ron!

NULL value will also be returned in the below two conditions:

-- When starting position is negative
SELECT STUFF(@str, -1,5,@stx)
-- When starting position is greater than the expression length => LEN(@str)
SELECT STUFF(@str, 7,5,@stx)



~ Lokesh Vij

Guidelines for quicker answers on T-SQL question
Guidelines for answers on Performance questions

Link to my Blog Post --> www.SQLPathy.com

Follow me @Twitter

Post #1394468
Posted Monday, December 10, 2012 12:21 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 2:10 AM
Points: 5,209, Visits: 6,927
Interesting question, Thanks, Ron

____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
Post #1394469
Posted Monday, December 10, 2012 1:42 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Friday, August 19, 2016 4:23 AM
Points: 1,659, Visits: 997
Guess you have to know your stuff to get today's QOTD right...
Post #1394481
Posted Monday, December 10, 2012 2:00 AM
SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Wednesday, February 20, 2013 1:45 AM
Points: 616, Visits: 97
Simple question to start on monday:)
Post #1394488
Posted Monday, December 10, 2012 2:38 AM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Today @ 1:36 AM
Points: 15,289, Visits: 13,074
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
Post #1394503
Posted Monday, December 10, 2012 3:17 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Thursday, September 19, 2013 4:30 AM
Points: 78, Visits: 195
Nice question.However it will fetch error in SQL 2005 not sure about upper version as we can not assign value while declaration.
Post #1394515
Posted Monday, December 10, 2012 4:07 AM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Yesterday @ 8:08 AM
Points: 536, Visits: 600
More STUFFing - it must be nearly Christmas. Thanks for the question.
Post #1394530
Posted Monday, December 10, 2012 4:21 AM


Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Thursday, June 12, 2014 4:19 AM
Points: 701, Visits: 1,145
Thanks for the great Monday morning question.
Post #1394537
Posted Monday, December 10, 2012 4:56 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Friday, August 19, 2016 2:13 AM
Points: 2,224, Visits: 7,969
The explanation is fine for the second example.
But there's no mention of why a NULL value for 'replace with' returns a non-null result.
This confused me when I first came across it, and confuses me still!
Post #1394550
« Prev Topic | Next Topic »

Add to briefcase 1234»»»

Permissions Expand / Collapse