CREATE FUNCTION [dbo].[RandInt](
@GuidValue as uniqueidentifier
)
RETURNS int
AS
BEGIN
declare @str as varchar(10)
set @str=left(@GuidValue,8)
declare @i as int
declare @number as int
set @i=0
set @number=0
while(@i<8)
begin
set @number=@number + (Ascii((substring(@str,@i+1,1)))*Power(10,@i))
set @i=@i+1
end
return @number
END
@GuidValue as uniqueidentifier
)
RETURNS int
AS
BEGIN
declare @str as varchar(10)
set @str=left(@GuidValue,8)
declare @i as int
declare @number as int
set @i=0
set @number=0
while(@i<8)
begin
set @number=@number + (Ascii((substring(@str,@i+1,1)))*Power(10,@i))
set @i=@i+1
end
return @number
END