|
-
Aug 4th, 2002, 11:01 PM
#1
Thread Starter
Member
Help !!!
Dear All
I have a store procedure at SQL server 2000 such :
CREATE PROCEDURE CheckRecord @Record as varchar(35),@Table as varchar(20) output
with recompile
AS
declare @Rec as float
select @Table = ''
select @Rec = count(*) from Table1 where Number = @Record
if @Rec > 0
begin
select @Table = 'Table1'
end
select @Table = ''
select @Rec = count(*) from Table2 where Number = @Record
if @Rec > 0
begin
select @Table = 'Table2'
end
select @Table = ''
select @Rec = count(*) from Table3 where Number = @Record
if @Rec > 0
begin
select @Table = 'Table3'
end
My Question is how to stop store procedure if rec has found in table2 ?
Please help ...
Thx a lot,
Regards,
Long
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|