Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

isnumeric

2 views
Skip to first unread message

etragu

unread,
May 2, 2007, 9:03:23 AM5/2/07
to
hola
alguien me puede explicar esto?

select isnumeric('0007678,03') da 1 verdadero
select isnumeric('00011,00') da 0 falso!!!!

no entiendo la diferencia
gracias


Maxi

unread,
May 2, 2007, 9:18:27 AM5/2/07
to
Hola, SQL no usa comas sino puntos

--

Salu2

-----------------------------------------
Microsoft MVP SQL Server
Culminis Speaker
------------------------------------------
"etragu" <Nando> escribió en el mensaje
news:OhRUcmLj...@TK2MSFTNGP02.phx.gbl...

Rubén Vigón

unread,
May 2, 2007, 9:45:37 AM5/2/07
to
Realmente curioso, sí...

Un intrigado saludo,

Rubén Vigón
Microsoft MVP Visual Basic
http://vigon.mvps.org

Salvador Ramos

unread,
May 2, 2007, 11:15:21 AM5/2/07
to
Con qué versión, edición y service pack lo has probado ?
Yo acabo de probarlo con SQL Server 2005 developer edition, sp1, y funciona
correctamente.

--
Un saludo
Salvador Ramos
------------------------------------------------
www.sqlserverymicrosoft.net (información sobre SQL Server y .NET)
www.sqlserverymicrosoft.net/acerca_de_salvador_ramos.htm
[SQL Server MVP]
------------------------------------------------


"etragu" <Nando> escribió en el mensaje
news:OhRUcmLj...@TK2MSFTNGP02.phx.gbl...

etragu

unread,
May 2, 2007, 11:38:15 AM5/2/07
to
La verdad que es raro
ahi les mando mas info
un saludo

select @@version
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------
Microsoft SQL Server 2000 - 8.00.2039 (Intel X86)
May 3 2005 23:18:38
Copyright (c) 1988-2003 Microsoft Corporation
Standard Edition on Windows NT 5.0 (Build 2195: Service Pack 4)


(1 filas afectadas)

"Salvador Ramos" <webmaster...@YEstoHelpdna.net> escribió en el
mensaje news:OAZdDzMj...@TK2MSFTNGP06.phx.gbl...

::romovi::

unread,
May 2, 2007, 11:49:28 AM5/2/07
to
etragu escribió:
Prueba en SQL Server 2005 SP2, funciona correctamente.
Prueba en SQL 2000 SP2, el error se presenta tal cual lo expone "etragru"

Claramente es un "bug" de SQL Server 2000

Saludos!!!


Rubén Vigón

unread,
May 2, 2007, 12:03:30 PM5/2/07
to
Un asunto realmente curioso...
Lo he preguntado en el foro privado de SQL Server y el "monstruo" Steve Kass me lo ha aclarado; ahí os va su respuesta:
_________________________________________

Rubén,

For unknown reasons, in SQL Server 2000, only certain numbers of digits were allowed before the leftmost comma of a string in order for it to be convertible
to [money]. Specifically, there had to be exactly 0, 1, 2, 3, or 7 digits before the leftmost comma

http://groups.google.com/group/microsoft.public.sqlserver.programming/msg/d18c80c6231b5a14

This restriction has apparently been removed in SQL Server 2005, and any number of digits is allowed before the comma so long as overflow doesn't occur. Nice of you to have noticed this!

It's worth pointing out that the comma is ignored in the conversion to money, and it is never treated as a "decimal point," despite regional conventions in much of the world

declare @t table (
n int
)
insert into @t values (0) insert into @t values (1)
insert into @t values (2) insert into @t values (3)
insert into @t values (4) insert into @t values (5)
insert into @t values (6) insert into @t values (7)
insert into @t values (8) insert into @t values (9)
insert into @t values (10) insert into @t values (11)
insert into @t values (12)

select
cast(quotename(T1.n)+','+quotename(T2.n) as varchar(14)) as [[left]],[right]]],
isnumeric(replicate('1',T1.n) + ',' + replicate('1',T2.n)) as [isnumeric], replicate('1',T1.n) + ',' + replicate('1',T2.n) as [string]
from
@t as T1
cross join @t as T2
where
T1.n + T2.n <= len('922337203685477')
_________________________________________

Un saludo!

0 new messages