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 ««123»»

How many rows? Expand / Collapse
Author
Message
Posted Friday, August 27, 2010 3:06 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, February 10, 2011 2:25 AM
Points: 15, Visits: 7
Good One!
Post #976236
Posted Friday, August 27, 2010 6:19 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Yesterday @ 6:45 AM
Points: 1,333, Visits: 1,701
hardik.doshi (8/27/2010)
ISNUMERIC is returing 0 so implicit conversation is not converting BLANK to ZERO. Therefore the reason behind this is something else.


Not so. You can easily prove that SQL Server does in fact convert blank strings to 0 with the following statement:

select cast('' as int)

ISNUMERIC doesn't work in this case because it doesn't actually try the conversion. It uses a different code path to determine whether a string is convertible to numeric, and that codepath does not follow exactly the same logic as the conversion code path. As Hugo said, this is best characterized as a bug in ISNUMERIC.

For a better example of why you shouldn't depend on ISNUMERIC, try the following two queries:

select cast('.' as float)

select isnumeric('.')

(edited to make final example more clear)
Post #976322
Posted Friday, August 27, 2010 8:04 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 @ 8:30 AM
Points: 3,946, Visits: 3,640
Interesting question, thanks.
Post #976421
Posted Friday, August 27, 2010 8:30 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, September 16, 2014 7:35 AM
Points: 2,817, Visits: 2,563
Great question. QoTD regularly reinforces a best practice: make everything explicit.
Post #976445
Posted Friday, August 27, 2010 11:49 AM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Today @ 2:39 PM
Points: 17,723, Visits: 15,587
Thanks - we have another reason for ensuring specificity on our conversions.



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 #976626
Posted Friday, August 27, 2010 12:52 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: Monday, July 14, 2014 10:08 AM
Points: 598, Visits: 3,816
Good question - thanks!

______________________________________________________________________
The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge. - Stephen Hawking
Post #976685
Posted Saturday, August 28, 2010 12:30 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, February 6, 2014 4:15 AM
Points: 1,242, Visits: 1,546
I learn new thing.. thx



Thanks
Vinay Kumar
-----------------------------------------------------------------
Keep Learning - Keep Growing !!!
www.GrowWithSql.com

Post #976901
Posted Saturday, August 28, 2010 12:36 PM
SSC-Enthusiastic

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

Group: General Forum Members
Last Login: Monday, September 15, 2014 3:43 AM
Points: 117, Visits: 464
nice question..
Post #976990
Posted Monday, August 30, 2010 3:45 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, October 10, 2012 4:59 AM
Points: 12, Visits: 33
I so very agree
Post #977208
Posted Wednesday, September 1, 2010 12:29 AM
SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Tuesday, July 23, 2013 6:34 AM
Points: 654, Visits: 265
Interesting question!
Post #978511
« Prev Topic | Next Topic »

Add to briefcase ««123»»

Permissions Expand / Collapse