Creating a PDF from a Stored Procedure in SQL Server
A short but interesting article, the author has figured out a way to create a PDF from a stored procedure without using a third party library.
2019-09-20 (first published: 2003-08-26)
74,043 reads
CREATE FUNCTION RemoveCharacter
-- Input dimensions in centimeters
(@CharToRemove Char(1), @StringToModify VarChar(25))
RETURNS VarChar(25) -- Cubic Centimeters.
AS
BEGIN
DECLARe @Count int
SET @Count = 0
DECLARE @Length int
SET @Length = LEN(@StringToModify)
WHILE @Count < @Length
Begin
IF LEFT( @StringToModify,1) = @CharToRemove
BEGIN
SET @StringToModify = SUBSTRING (@StringToModify, 2, LEN(@StringToModify))
SET @Count = @Count + 1
END
ELSE
BEGIN
SET @Count = @Length
END
END
RETURN @StringToModify
END