Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Else Do nothing

Posted on 2006-10-31
3
1,317 Views
Last Modified: 2008-02-26
I have T-SQL code that goes through a bunch of IF - ELSE statements, at the end I would like to say ELSE do nothing. How do I do that?
0
Comment
Question by:MorDeRor
3 Comments
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 500 total points
ID: 17842215
Just dont specify the 'ELSE' clause


IF 1= 1
SELECT 1
0
 
LVL 11

Expert Comment

by:Otana
ID: 17842218
Just don't include the ELSE part, it's not mandatory.

For example:

IF @test = 1
  BEGIN
    SELECT * FROM Table1
  END
0
 
LVL 28

Expert Comment

by:imran_fast
ID: 17842271
>>bunch of IF - ELSE statements

if Cond1
Stmt1
else
     if Cond2
      Stmt2
      else
           if cond3
           Stmt3
 
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question