What do you mean by OT?

I know that on MS SQL Server, it does not allow you to
break up a sql statement like that.  Making the
assumption that the rule applies and is the same on
other db's.
you would have to do it like this:

create proc test1 @groupid int
if @groupid = 0
begin
select * from groups
end
ELSE
begin
select * from groups
where groupid = @groupid
end

GOOD LUCK
--- William J Wheatley <[EMAIL PROTECTED]> wrote:
> WITH THE IF/ELSE/ on Stored Procedures is there a
> way to write a storedproc
> so it was like this
> 
> 
> SELECT *
> from member
> where membernumber <>0
> 
> IF @name is "0"
> and name='blah'
> end
> if @this eq "that"
> and that='test'
> end
> 
> to make it only run certain things if certain values
> are set
> 
> 
> Bill Wheatley
> Director of Development
> AEPS INC
> Allaire ColdFusion Consulting Partner
> Allaire Certified ColdFusion Developer
> http://www.aeps.com
> ICQ: 417645
> http://www.aeps2000.com
> 954-472-6684 X303
> 
> IMPORTANT NOTICE:
> This e-mail and any attachment to it is intended
> only to be read or used by
> the named addressee.  It is confidential and may
> contain legally privileged
> information.  No confidentiality or privilege is
> waived or lost by any
> mistaken transmission to you.  If you receive this
> e-mail in error, please
> immediately delete it from your system and notify
> the sender.  You must not
> disclose, copy or use any part of this e-mail if you
> are not the intended
> recipient.  The RTA is not responsible for any
> unauthorized alterations to
> this e-mail or attachment to it
> 
> 
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to