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: )

171 reads

Blogs

Welcome to 3Cloud …

By

A little over a month ago, Pragmatic Works Consulting was a part of a...

Daily Coping 23 Oct 2020

By

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

One Thousand SQL Saturdays (*ish)

By

This weekend is SQL Saturday #1000, running virtually from Oregon. It’s a good schedule,...

Read the latest Blogs

Forums

REST API through SSIS

By rocky_498

I want to call (REST) API the "GET" command and assign the return value...

How to reduce physical size of database

By coolchaitu

I deleted few tables having millions of records, but when see the physical space,...

How to get these description from XML into the table?

By NewDBA201

  I want all these description in different row. TIA Example descriptions 0|Home 1|Office|False...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers