I need to alter a select statement so that a returned field does not have an unwanted carriage return at the end.

I think the code below would remove all the carriage returns but I only want to remove one if it appears at the very end of the string.

SELECT REPLACE([parameters],Char(10),'') as [parameters]
FROM QUERIES