Solved

Else Do nothing

Posted on 2006-10-31
3
1,286 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
Comment Utility
Just dont specify the 'ELSE' clause


IF 1= 1
SELECT 1
0
 
LVL 11

Expert Comment

by:Otana
Comment Utility
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
Comment Utility
>>bunch of IF - ELSE statements

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

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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 …
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now