Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- USE [oktell]
- GO
- /****** Object: UserDefinedFunction [dbo].[GetTimeFromSecond] Script Date: 07.08.2019 9:32:01 ******/
- SET ANSI_NULLS ON
- GO
- SET QUOTED_IDENTIFIER ON
- GO
- -- =============================================
- -- Author: <Author,,Name>
- -- Create date: <Create Date, ,>
- -- Description: <Description, ,>
- -- =============================================
- CREATE FUNCTION dbo.GetMounthFromNum
- (@MounthNum int)
- RETURNS NVARCHAR(50) AS
- BEGIN
- DECLARE @Months TABLE (
- NUMBER INT
- ,[Name] NVARCHAR(20)
- )
- INSERT INTO @Months
- VALUES (1, 'Январь')
- INSERT INTO @Months
- VALUES (2, 'Февраль')
- INSERT INTO @Months
- VALUES (3, 'Март')
- INSERT INTO @Months
- VALUES (4, 'Апрель')
- INSERT INTO @Months
- VALUES (5, 'Май')
- INSERT INTO @Months
- VALUES (6, 'Июнь')
- INSERT INTO @Months
- VALUES (7, 'Июль')
- INSERT INTO @Months
- VALUES (8, 'Август')
- INSERT INTO @Months
- VALUES (9, 'Сентябрь')
- INSERT INTO @Months
- VALUES (10, 'Октябрь')
- INSERT INTO @Months
- VALUES (11, 'Ноябрь')
- INSERT INTO @Months
- VALUES (12, 'Декабрь');
- RETURN (SELECT [Name] FROM @Months WHERE NUMBER = @MounthNum)
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement