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
 Transact-SQL (2000)
 syntax help

Author  Topic 

esthera
Master Smack Fu Yak Hacker

1410 Posts

Posted - 2005-12-19 : 03:04:30
I have an sp and in the sp I want to do the following

@mycount="select count(id) from users where source=5
if @mycount is an even number then
begin
execute an sql statement
end

can someone help me with the exact syntax for this?

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-12-19 : 03:07:58

EDIT:
Thats wrong link

@mycount="select count(id) from users where source=5
if @mycount %2 =0
begin
execute an sql statement
end

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

esthera
Master Smack Fu Yak Hacker

1410 Posts

Posted - 2005-12-19 : 03:13:46
I get a page cannot be displayed by that link
Go to Top of Page

shallu1_gupta
Constraint Violating Yak Guru

394 Posts

Posted - 2005-12-19 : 03:48:57
select @mycount = count(id) from users where source=5
if @mycount %2 = 0
begin
execute an sql statement
end
Go to Top of Page
   

- Advertisement -