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)
 Executing a Stored procedure

Author  Topic 

SKP
Starting Member

34 Posts

Posted - 2006-08-18 : 11:41:43
Hi!
I am executing a stored procedure called PR_GET_CALLBACK_PERIOD

It returns the following result:
D_CALL_BACK CALLBACKDATE V_EMPLOYEE
2006-08-24 16:00:00.000 something1 Ruby Hill
2006-08-24 16:00:00.000 something1 Tiger Woods

2006-08-24 16:20:00.000 something1 NULL
2006-08-24 16:40:00.000 something1 NULL

Now how can I run a query upon the above result to check if there are more than 2 V_EMPLOYEE in the same D_CALL_BACK. Remember D_CALL_BACK is dynamic.

nr
SQLTeam MVY

12543 Posts

Posted - 2006-08-18 : 11:49:30
insert #a
exec PR_GET_CALLBACK_PERIOD

select D_CALL_BACK
from #a
group by D_CALL_BACK
having count(distinct V_EMPLOYEE) > 2

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-08-21 : 01:39:02
Note that you need to create table #a which has similar structure of result of SP

Madhivanan

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

- Advertisement -