Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

What are Conditional Statements, Iterative Statements and Sequential Statements available in SQL Server 2000 ?

Posted on 2006-05-29
3
Medium Priority
?
373 Views
Last Modified: 2012-05-05

Hi,

What are Conditional Statements, Iterative Statements and Sequential Statements available in SQL Server 2000 !

EX:

Conditional Statements (IF)
Iterative Statements  (WHILE)
Sequential Statements (GOTO)

Thanks,
Kishore
0
Comment
Question by:kishore_peddi
3 Comments
 
LVL 5

Accepted Solution

by:
bwdowhan earned 600 total points
ID: 16787223
Hi Kishore,

If you have SQL Server 2000 installed, the best source of information is Books Online. You have the correct statement names for conditional, iterative, and sequential statements...

Conditional:
   You can use IF and IF...ELSE

Iterative:
   (WHILE @v_counter > 0) BEGIN.... END

Sequential:
   Even though this is possible by using labels in your stored procedure, I don't think it is a very good option. GOTO is typically looked at as poor programming in most languages and there are usually better ways to handle what you need to do.

Again... Check out books on-line

Brian
0
 
LVL 75

Assisted Solution

by:Aneesh Retnakaran
Aneesh Retnakaran earned 450 total points
ID: 16788490
One more to Conditional:
       CASE ...

     

 
0
 
LVL 28

Assisted Solution

by:imran_fast
imran_fast earned 450 total points
ID: 16788492
Conditional Statements (IF)

you have Case statements which you can use for conditions

select Case Column1
           when  0 then 'zero'
           when  10 then 'Ten'
           when  100 then 'Hundred'
            else   'More Then Hundred'
end
from YourTable
   
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Suggested Courses

810 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