Call this function in your SP.Pass the arguments and get the result.
We searched a lot in WWW but could not find a code in SQL to find ratio.
When we wrote this simple thing..We thought letz share it across.Sharing is Expansion.
asaratsaga,
2010-06-23 (first published: 2010-06-01)
Call this function in your SP.Pass the arguments and get the result.
We searched a lot in WWW but could not find a code in SQL to find ratio.
When we wrote this simple thing..We thought letz share it across.Sharing is Expansion.
--Author Srikanth & Subin --contact srikanthv1980@yahoo.com,subruj@yahoo.com --Finding ratio in SQL --Call this function in your SP and enjoy create function FindRatio(@n1 int,@n2 int) returns varchar(30) as begin declare @counter int declare @hcf int declare @ratio varchar(30) declare @max int if((@n1=0) or (@n2=0)) begin set @ratio=convert(varchar,@n1)+':'+convert(varchar,@n2) end else begin if(@n1>@n2) set @max=@n1 else set @max=@n2 set @counter=2 while (@counter<=@max) begin if((@n1%@counter=0) and (@n2%@counter=0)) begin set @hcf=@counter set @n1=@n1/@hcf set @n2=@n2/@hcf end else begin set @counter=@counter+1 end end set @ratio=convert(varchar,@n1)+':'+convert(varchar,@n2) end return @ratio end
The goal of this article to show how to get unique transactions per client per month from the data set containing multiple transactions per client per month.
This article will demonstrate a method of creating an Excel-based CPU/scheduler performance dashboard for SQL Server 2005+.
Learn how you can get the userid of someone connected to Reporting Services and use that information to determine if they can view the report.
2017-12-22 (first published: 2010-05-18)
8,144 reads
Booster Kit for project involving SSIS / SSAS / SSRS