DataBase/MS-SQL
MS-SQL .. ORACLE 의 TRUNC 따라 하기..
/* 오라클의 TRUNC 따라하기~ */ DECLARE @SrcNum NUMERIC(32,10), @CutCnt INT DECLARE @l_RETURN VARCHAR(500), @l_SRC VARCHAR(500) SET @SrcNum = ROUND(@SrcNum, @CutCnt, 1) SET @l_SRC = CAST(@SrcNum AS VARCHAR(500)) IF (CHARINDEX('.', @l_SRC) > 0) BEGIN WHILE (1=1) BEGIN IF (RIGHT(@l_SRC, 1) = '0') BEGIN SET @l_SRC = SUBSTRING(@l_SRC, 1, LEN(@l_SRC) - 1) END ELSE IF (RIGHT(@l_SRC, 1) = '.') BEGIN SET @l_SRC ..
2007. 12. 4. 14:07