/ ************************************************** ********************* Function Name: getMaxSqrt (@SQRTTYPE) Parameters: @SQRTTYPE Defines Table @maxsqrtid with Values: Return to Max (SQRT) 1 Return Number Power by adpostemail: ZRSZ@hotmail.com **************************************************** ************************************************ / CREATE FUNCTION GETMAXSQRT (@SQRTTYPE AS INT) Returns INTWITH ENCRYPTIONASBEGIN DECLARE @MaxSqrtid as INT IF (@ SqrtType = 1) begin select @MaxSqrtID = max (CategorySqrt) from LXBIZ_Category end if (@ SqrtType = 2) begin SELECT @MaxSqrtID = max (SubClassSqrt) fROM LXBIZ_SubClass end if (@MaxSqrtID is null) begin select @MaxSqrtID = 0 end return @ MaxSqrtid 1END