clear markdown compare help best fiddles feedback dbanow.uk a leap of faith?
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 2335853 fiddles created (27451 in the last week).

CREATE TABLE #temp ( fieldname varchar(10) );
 hidden batch(es)


INSERT INTO #temp ( fieldname ) VALUES ('"bla"'), ('"bla'), ('bla"'), ('bla'), ('bla '), ('bla "');
6 rows affected
 hidden batch(es)


SELECT CASE WHEN RIGHT(fieldname,1) = '"' AND LEFT(fieldname,1) = '"' THEN REVERSE(STUFF(REVERSE(STUFF(fieldname, 1, 1, '')), 1, 1, '')) WHEN RIGHT(fieldname,1) = '"' THEN REVERSE(STUFF(REVERSE(fieldname), 1, 1, '')) WHEN LEFT(fieldname,1) = '"' THEN STUFF(fieldname, 1, 1, '') ELSE fieldname END as fieldname FROM #temp
fieldname
bla
bla
bla
bla
bla
bla
 hidden batch(es)