十二个月份的英文缩写,只有五月份是全称与缩写一样,其它月份的缩写仅是取前三位字母。因此Insus.NET写成一个自定义函数:
-- =============================================
-- Author: Insus.NET
-- Create date: 2012-12-18
-- Description: Get Month abbreviation name
-- =============================================
CREATE FUNCTION [dbo].[udf_MonthShortName]
(
@input DATETIME
)
RETURNS NVARCHAR(3)
AS
BEGIN
DECLARE @rtn NVARCHAR(3)
SET @rtn = SUBSTRING(DATENAME(MONTH,@input), 1, 3)
RETURN @rtn
END