TSQL: Convert String to Money Data Type

You have a string that contains the value $1,230.23 and you want to convert to a money data type.  The following works for SQL Server 2012.

DECLARE @RawString varchar(10)
SET @RawString = '$1,230.23'
SELECT @RawString
SELECT PARSE(@RawString AS MONEY)

About AussieBICG

Connect with me here https://au.linkedin.com/in/aussiebicg

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s