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. 2335566 fiddles created (27415 in the last week).

CREATE TABLE dbo.temp(col varchar(255));
 hidden batch(es)


INSERT dbo.temp(col) SELECT 'foo' UNION ALL SELECT '"bar"' UNION ALL SELECT 'blat"' UNION ALL SELECT '"mort';
4 rows affected
 hidden batch(es)


SELECT col = SUBSTRING(t.col, x.s + 1, LEN(t.col) - x.s - x.e) FROM dbo.temp AS t CROSS APPLY ( SELECT IIF(LEFT (col, 1) = '"', 1, 0), IIF(RIGHT(col, 1) = '"', 1, 0) ) AS x (s, e) ;
col
foo
bar
blat
mort
 hidden batch(es)