About 76,100 results
Open links in new tab
  1. 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

  2. IF STATEMENT IN WHERE CLAUSE - SQLServerCentral Forums

    Aug 8, 2008 · Unless a statement block is used, the IF or ELSE condition can affect the performance of only one Transact-SQL statement. To define a statement block, use the …

  3. IF versus CASE statements – SQLServerCentral Forums

    Nov 15, 2011 · He's testing a single static condition and the ELSE clause in the CASE does an unnecessary update. If the condition depended on some column, then the CASE would be …

  4. How to return Null or value when nothing is returned from Query

    Oct 10, 2011 · I have a simple query: SELECT name FROM atable WHERE a = 1 I want it to return Null if it finds nothing, but it just returns an empty set. Is it possible to do this?

  5. How to return 0 if not exists, or the result if exists?

    Dec 14, 2011 · I know that a solution would be to use: something like "SELECTA.*, Score = (CASE WHEN EXISTS (sqlStatement) THEN sqlStatement ELSE 0 END)" but this would …

  6. Do nothing in a sql statement--help - SQLServerCentral Forums

    Sep 25, 2009 · How do you write a "do nothing" in sql. I have a statement where if two variables are 0, I don't want anything to execute for example if a=0 and b=0 'do nothing else select * …

  7. If/Then in table valued functions – SQLServerCentral Forums

    Jun 17, 2013 · Not in an in-line table valued function. If you want anything other than a single select statement, you need a multi-statement table-valued function, though be very careful as …

  8. Are my nested IF/ELSE statements inefficient? Is

    May 16, 2017 · Are my nested IF/ELSE statements inefficient? Is there an alternative or 'best practice' Forum – Learn more on SQLServerCentral

  9. If...Else condition in store procedure to set value in variable

    Jul 20, 2010 · hi,i want to select my data from table using where clause.then i want to use if else condition to set the output parameter value as 1 else 0.so that i can call this in my asp.net code.

  10. Using a SET statement inside of a CASE Statement

    Feb 19, 2021 · I want to update the contents of a variable using a CASE Statement; for example: I declare the variable and set the initial value, then I want to use a CASE Statement to append …