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

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


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 7:16 PM
Points: 5,603, Visits: 25,017
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: Tuesday, June 24, 2014 6:38 PM
Points: 1,371, Visits: 1,560
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


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Today @ 2:35 AM
Points: 3,930, Visits: 5,120
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


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Friday, July 4, 2014 9:03 AM
Points: 1,415, Visits: 796
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


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 1:47 AM
Points: 13,644, Visits: 10,537
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 #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


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, August 27, 2014 3:53 AM
Points: 108, Visits: 208
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
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Friday, August 29, 2014 10:20 AM
Points: 1,740, Visits: 6,366
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