TextToDecimal

SUMMARY:This UDF script takes a text value(nvarchar) and returns a decimal(18,6) number. If the text value can't be interpreted as numeric, the UDF returns NULL.-----------------------------------------------USAGE: SET @MyDecimal = dbo.TextToDecimal('-$123,456.73')@MyDecimal will now be -123456.730000SET @MyDecimal = dbo.TextToDecimal('-$123,4560.73') --bad number format@MyDecimal will now be NULL------------------------------------------------------DESCRIPTION:The ISNUMERIC function incorrectly returns 1 (True) for many non-numeric text values. Even […]

5 (1)

2005-11-02 (first published: )

173 reads

Blogs

Stellar Toolkit for MS SQL - Software Review

By

As a SQL database administrator, I am responsible for maintaining our organization's SQL Server...

Behavior of numeric data types with ”

By

As we all know, there are various numeric data types, such as TINYINT, INT,...

Daily Coping 5 Mar 2021

By

I started to add a daily coping tip to the SQLServerCentral newsletter and to...

Read the latest Blogs

Forums

shared datasets and cache refresh option

By ricky969

hi guys! Problem:  1) Every time I overwrite an existing shared dataset (with a...

Question on report server database

By itmasterw 60042

Hi,   We just installed SQL Server 2019 on a new server and moved...

Disclosing the How

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Disclosing the How

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers