sql scalar function to remove extra characters from string based on maxlength

Viewed 29
ALTER FUNCTION [dbo].[MinMaxValue]
(
@P_TeiValue NVARCHAR(5),
@P_Input NVARCHAR(255)

)
RETURNS NVARCHAR(255)
BEGIN

DECLARE @P_Result NVARCHAR(255)
 SET @P_Result = 'select MinLength,MaxLength from fh.SPEC_XSD_TEI with(nolock) where tei'+@P_TeiValue

 RETURN @P_Result
END

like if i will send test and maxlength is 1 .it will return t only.

0 Answers
Related