Hello:
I have the following function which I found in the internet and modified for my purposes, and I cannot make it to work. I keep getting the same error-
"Invalid length parameter passed to the LEFT or SUBSTRING function."
I tried everything as shrinking the field size for the parameter and matching all variables to the same size, also changing the varchar for nvarchar, etc.
Please help!
ALTER FUNCTION [dbo].[ConvertTabsToSpaces] (@String varchar(7000))
RETURNS varchar(7000) AS
BEGIN
DECLARE
@start int,
@tempnote varchar(7000),
@temp char(1)
set @start=CHARINDEX(char(9), @String)
set @tempnote=substring(@String,1,(@start-1)) + ' '
While len(@String) > @start
begin
set @temp=substring(@String,@start,1)
IF @temp <> char(9)
begin
set @tempnote=@tempnote + @temp
end
else
begin
set @tempnote=@tempnote + ' '
end
SET @start=@start+1
END
RETURN(@tempnote)
end
thank you.
Thank you very much. Since the field had different kind of characters, I had to use the following:
Replace(Replace(Replace(Re
Thank you again.