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

Counting spaces with datalength Expand / Collapse
Author
Message
Posted Monday, March 1, 2010 11:11 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Thursday, October 23, 2014 11:58 AM
Points: 1,676, Visits: 1,758
Comments posted to this topic are about the item Counting spaces with datalength
Post #874871
Posted Monday, March 1, 2010 11:11 PM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Today @ 8:21 AM
Points: 17,843, Visits: 15,789
Interesting Question


Thanks




Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server, MVP


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Post #874872
Posted Monday, March 1, 2010 11:20 PM


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: Thursday, March 27, 2014 8:16 AM
Points: 534, Visits: 282
Looked at the MSDN article posted before trying to answer - had to search elsewhere as the MSDN en try wasn't very illuminating :)

Kelsey Thornton
MBCS CITP
Post #874876
Posted Tuesday, March 2, 2010 1:26 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Wednesday, October 1, 2014 12:40 AM
Points: 2,072, Visits: 370
thanks for the question.... was really not aware of datalength function..
Post #874921
Posted Tuesday, March 2, 2010 6:29 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Wednesday, October 15, 2014 6:55 AM
Points: 883, Visits: 876
When your name is in the explanation, and you get it wrong, well that's just embarrassing.

Ron Moses


-----
a haiku...

NULL is not zero
NULL is not an empty string
NULL is the unknown
Post #875074
Posted Tuesday, March 2, 2010 7:01 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Wednesday, October 15, 2014 9:22 AM
Points: 487, Visits: 258
Very interesting. I typically use LEN but I can see how datalength would be useful.
Post #875112
Posted Tuesday, March 2, 2010 7:36 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Monday, September 26, 2011 10:38 AM
Points: 331, Visits: 52
Great question; it also really highlights the difference between Len() and DataLength(). For fun folks should try substituting Len for DataLength.
Post #875157
Posted Tuesday, March 2, 2010 7:39 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Friday, February 4, 2011 7:20 AM
Points: 977, Visits: 1,499
Nice question. Makes ya think.

Tom Garth
Vertical Solutions

"There are three kinds of men. The one that learns by reading. The few who learn by observation. The rest of them have to pee on the electric fence for themselves." -- Will Rogers
Post #875163
Posted Tuesday, March 2, 2010 12:47 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 7:54 AM
Points: 7,814, Visits: 9,562
Good question.

I don't know whether to be more worried that 198 people so far thought datalength behaved like length or that 118 thought 11 was an even number!


Tom
Post #875461
Posted Wednesday, March 3, 2010 6:43 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, September 3, 2014 6:35 AM
Points: 33, Visits: 115
-- Sorry, I get 1 for count(1) using datalength(), record 8.
-- count(1) for Len() rerturns 0
-- What am i doing wrong?

oops, nevermind...
Post #875921
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse