﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Article Discussions / Article Discussions by Author / Discuss content posted by Vampire  / Script to calculate Precision &amp;amp; Scale of a Decimal Value / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Tue, 18 Jun 2013 21:51:08 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Script to calculate Precision &amp; Scale of a Decimal Value</title><link>http://www.sqlservercentral.com/Forums/Topic1311438-1382-1.aspx</link><description>That is true.. your script evaluates in the same way as mine does. As noted, there exists many approaches that includes yours.However, the SUBSTRING function along with CHARINDEX seems costlier than the PARSENAME...Neverthless, thanks for adding this code piece :)</description><pubDate>Fri, 22 Jun 2012 10:35:27 GMT</pubDate><dc:creator>Lonely Rogue</dc:creator></item><item><title>RE: Script to calculate Precision &amp; Scale of a Decimal Value</title><link>http://www.sqlservercentral.com/Forums/Topic1311438-1382-1.aspx</link><description>DECLARE @D DECIMAL(18,9) ,@S VARCHAR(20) ,@R VARCHAR(20) ,@Pos SMALLINTSET @D = 5.1235698SET @S = CAST(@D AS VARCHAR(20))SET @R = REVERSE(SUBSTRING(@S, CHARINDEX('.', @S) + 1, 20))SET @Pos = PATINDEX('%[1-9]%' , @R)IF @Pos = 0 SELECT 0ELSE SELECT LEN(SUBSTRING(@R, @Pos, 20)) AS Length</description><pubDate>Tue, 19 Jun 2012 06:54:41 GMT</pubDate><dc:creator>Sreepathi1987</dc:creator></item><item><title>Script to calculate Precision &amp;amp; Scale of a Decimal Value</title><link>http://www.sqlservercentral.com/Forums/Topic1311438-1382-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/scripts/PRECISION/91108/"&gt;Script to calculate Precision &amp;amp; Scale of a Decimal Value&lt;/A&gt;[/B]</description><pubDate>Tue, 05 Jun 2012 13:14:00 GMT</pubDate><dc:creator>Lonely Rogue</dc:creator></item></channel></rss>