CREATE FUNCTION dbo.getDateFormat(@p_brand varchar(64), @p_fieldName varchar(64), @p_value datetime)
RETURNS VARCHAR(4000)
AS
BEGIN
declare @val varchar(4000)
declare @format varchar(4000)
declare @sql varchar(4000)
set @format=
(SELECT top 1 TRAN_VALUE
FROM TB_MEMBER_CODETRAN
WHERE BRAND=@p_brand
AND FIELD_NAME=@p_fieldName
)
if @format='date' begin
set @val = (select @p_value)
end
else begin
set @val = (select dbo.FNDateFormat(convert(varchar(23),@p_value,121),@format))
end
return @val
END
'DB > MSSQL' 카테고리의 다른 글
[MSSQL]컬럼 목록 및 테이블 리스트 (0) | 2022.04.21 |
---|---|
[MSSQL]프로시져1 (0) | 2022.04.21 |
dblink3 (0) | 2019.04.02 |
dblink (0) | 2019.04.02 |
dblink2 (0) | 2019.03.22 |