About 24,400 results
Open links in new tab
  1. 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 …

  2. 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

  3. 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

  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 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 …

  8. 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 …

  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. check if record exists then update else insert - SQLServerCentral

    Nov 9, 2016 · i have to check if record exists in table , if there is record then update else insert. Stg_table Id seq name company 1 1 aaa yyy 1 2 aaa bbb table Id seq name company 1 1 aaa …