Technical Article

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)

You rated this post out of 5. Change rating

2005-11-02 (first published: )

192 reads

Blogs

Using OneLake for Excel Files in Microsoft Fabric

By

Hey data friends! This blog is to discuss an edge case I’ve run into...

Another AI Faux Pax

By

I was experimenting with a local model (article) and as a part of this,...

Monday Monitor Tips: Using the PowerShell API

By

Redgate Monitor has grown tremendously from its early days and I find many customers...

Read the latest Blogs

Forums

Sparse Column Defaults

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Sparse Column Defaults

The AI Budget Assistant

By Steve Jones - SSC Editor

Comments posted to this topic are about the item The AI Budget Assistant

Why Standards are Important

By David.Poole

Comments posted to this topic are about the item Why Standards are Important

Visit the forum

Question of the Day

Sparse Column Defaults

What are the restrictions for defaults on columns declared as sparse?

See possible answers