Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Place an IF clause in a Declare Cursor "CursorName" For

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-12-16 : 08:08:38
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

15732 Posts

Posted - 2005-12-16 : 08:10:22


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

22864 Posts

Posted - 2005-12-16 : 08:16:38
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
   

- Advertisement -