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 01, 2010 11:11 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Tuesday, April 01, 2014 2:53 PM
Points: 1,676, Visits: 1,744
Comments posted to this topic are about the item Counting spaces with datalength
Post #874871
Posted Monday, March 01, 2010 11:11 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 7:26 AM
Points: 20,455, Visits: 14,067
Interesting Question


Thanks




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


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #874872
Posted Monday, March 01, 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 02, 2010 1:26 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 2:13 AM
Points: 1,863, Visits: 368
thanks for the question.... was really not aware of datalength function..
Post #874921
Posted Tuesday, March 02, 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: 2 days ago @ 10:58 AM
Points: 819, Visits: 832
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 02, 2010 7:01 AM
SSC-Addicted

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

Group: General Forum Members
Last Login: Friday, March 07, 2014 4:39 PM
Points: 487, Visits: 247
Very interesting. I typically use LEN but I can see how datalength would be useful.
Post #875112
Posted Tuesday, March 02, 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 02, 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 04, 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 02, 2010 12:47 PM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Yesterday @ 4:56 PM
Points: 8,271, Visits: 8,717
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 03, 2010 6:43 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Tuesday, March 25, 2014 7:36 AM
Points: 33, Visits: 111
-- 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