22 lines
1.2 KiB
Transact-SQL
22 lines
1.2 KiB
Transact-SQL
USE [site_fuchs]
|
|
GO
|
|
/****** Object: UserDefinedFunction [dbo].[ocms_fn_randbetween] Script Date: 02.12.2020 21:05:05 ******/
|
|
DROP FUNCTION [dbo].[ocms_fn_randbetween]
|
|
GO
|
|
/****** Object: UserDefinedFunction [dbo].[ocms_fn_randbetween] Script Date: 02.12.2020 21:05:06 ******/
|
|
SET ANSI_NULLS ON
|
|
GO
|
|
SET QUOTED_IDENTIFIER ON
|
|
GO
|
|
|
|
|
|
CREATE FUNCTION [dbo].[ocms_fn_randbetween](@bottom integer, @top integer)
|
|
RETURNS integer
|
|
AS
|
|
BEGIN
|
|
RETURN (select cast(round((@top-@bottom) * [rn] +@bottom,0) as integer) from [dbo].[ocms_fn_rand])
|
|
END
|
|
GO
|
|
ALTER AUTHORIZATION ON [dbo].[ocms_fn_randbetween] TO SCHEMA OWNER
|
|
GO
|