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.
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_PERIODIt returns the following result:D_CALL_BACK CALLBACKDATE V_EMPLOYEE2006-08-24 16:00:00.000 something1 Ruby Hill 2006-08-24 16:00:00.000 something1 Tiger Woods2006-08-24 16:20:00.000 something1 NULL2006-08-24 16:40:00.000 something1 NULLNow 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 #aexec PR_GET_CALLBACK_PERIODselect D_CALL_BACKfrom #agroup by D_CALL_BACKhaving 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. |
 |
|
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 SPMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|