User Profile

Collapse

Profile Sidebar

Collapse
JonathanVH
JonathanVH
Last Activity: Feb 6 '10, 03:46 PM
Joined: Feb 6 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • 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...
    See more | Go to post

    Leave a comment:


  • Cte

    You could use a common table expression, e.g.:
    Code:
    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;
    To extend this:
    Code:
    WITH
    ...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...