SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO
CREATE FUNCTION [dbo].[to_varchar255] (@d varchar)
RETURNS varchar(255)
with execute as CALLER
    AS
    BEGIN
		declare @to_varchar varchar(255);
        set @d = replace(@d, '"', '');
		set @to_varchar = left(@d, 255);
			
		return (@to_varchar);
    END
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO

GO
