About 81,100 results
Open links in new tab
  1. IF STATEMENT IN WHERE CLAUSE - SQLServerCentral Forums

    Aug 8, 2008 · Dear All, I was wondering what the syntax what be to append an IF statement in the where clause for example SELECT * FROM employee WHERE IF @employee = 'Some value' THEN …

  2. Using a SET statement inside of a CASE Statement

    Feb 19, 2021 · I declare the variable and set the initial value, then I want to use a CASE Statement to append to that variable contents.

  3. Using CTE Common table expressions with SELECT CASE statement

    Feb 27, 2010 · So, I thought, I could trick Sql Server and use CASE statement with in a SELECT and get away SELECT CASE @r WHEN <some value> THEN <put the 200 lines of query with CTE_1 here>

  4. Performance of the SQL MERGE vs. INSERT/UPDATE

    Mar 4, 2014 · While the MERGE statement is a wonderfully useful query syntax that does offer some safety features over the traditional approach of UPDATE then INSERT, it does come with a slight …

  5. IF then Else statement not exiting – SQLServerCentral Forums

    Feb 6, 2025 · Monitoring tools external to SQL Server (SQL Sentry, SCOM, etc.) will register the job step as a failure and generate an alert - which you then have to adjust in the monitoring tool.

  6. The OUTPUT Clause for the MERGE Statements - SQLServerCentral

    Feb 2, 2012 · In this article, I will provide a set of examples to showcase the use of OUTPUT clause within the MERGE statement and how to capture the OUTPUT clause results into an archive table.

  7. MERGE Statement with two WHEN MATCHED Statements

    Jan 8, 2013 · The MERGE statement can have at most two WHEN MATCHED clauses. If two clauses are specified, then the first clause must be accompanied by an AND <search_condition> clause.

  8. ISNULL in a CASE statement??? – SQLServerCentral Forums

    Jan 21, 2008 · CASE [myRow] WHEN 1 THEN 'True' WHEN NULL THEN 'False' -- this line is my concern ELSE 'FALSE' END I want to know how to detect for NULL in a CASE statement.

  9. Conditional Statements in WHERE Clauses – SQLServerCentral

    May 22, 2001 · Conditional WHERE clauses in T-SQL using comparison operators Ever had a query where you wished you could be able to specify the operator (equal, not equal, greater than, etc.) for …

  10. Using Case or If Else statements within joins - SQLServerCentral

    Nov 22, 2010 · Home Forums SQL Server 2005 T-SQL (SS2K5) Using Case or If Else statements within joins Post reply