SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Place an IF clause in a Declare Cursor "CursorName" For
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

AskSQLTeam
Ask SQLTeam Question

USA
0 Posts

Posted - 12/16/2005 :  08:08:38  Show Profile  Visit AskSQLTeam's Homepage  Reply with Quote
Kentish writes "I want to place an If Clause In a Declare Cursor Statement

E.g

DECLARE CUR_X CURSOR FOR

IF @FieldName = 'All'
Select *
From TableName

IF @FieldName = 'Count'
Select Count(*)
From TableName"

robvolk
Most Valuable Yak

USA
15678 Posts

Posted - 12/16/2005 :  08:10:22  Show Profile  Visit robvolk's Homepage  Reply with Quote


Sometimes I wonder what I (or graz, or Damian) did in a past life to deserve questions like this.
Go to Top of Page

madhivanan
Premature Yak Congratulator

India
22765 Posts

Posted - 12/16/2005 :  08:16:38  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
Why do you need cursor?
Post your exact requirement and there should be better method than what you are trying to do

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000