This should only be an issue if you're using string literals in a script, in which case you can double the single quotes in the string, e.g.:
Code:
INSERT dbo.table_name(column1)
VALUES('Checking for ''hit'' instruction');
Based on your using double quotes around the value and calling its data type a "string," I infer that this value is coming from your front-end programming language, in which case you should use parameterized...
WITH BalCalc AS
(SELECT AccountNum, CASE WHEN Balance > 5000 THEN Balance * 2 ELSE Balance / 2 END AS BalanceCalculation
FROM dbo.tblFinance)
SELECT AccountNum, BalanceCalculation,
CASE WHEN BalanceCalculation > 6000 THEN 'Large Balance' ELSE 'Small Balance' END AS BalanceDescription
FROM BalCalc;
Leave a comment: