ALTER FUNCTION dbo.Translate (@Source VARCHAR(8000))
RETURNS VARCHAR(8000)
AS
BEGIN
-- do something
-- do more
--
-- at last
RETURN REPLICATE('a', 8000)
END
/*
TESTING:
SELECT dbo.Translate('blah')
Output:
aaaaaaaaaa..... 256 times
*/
Output value has length of 256, even though REPLICATE 8000 is used..... why? I am I missing something. Please help.