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 |
|
collie
Constraint Violating Yak Guru
400 Posts |
Posted - 2004-12-22 : 03:11:57
|
| Hi,I have a sp that returns a list of customers whose status=5 such as select customerid from customers where status=5I want to run a second sp that will call the first sp but will return the cumstomerids that are bigger than 5 for example.The result could return many rows.Is there a way of doing it?Thanks |
|
|
AndyB13
Aged Yak Warrior
583 Posts |
Posted - 2004-12-22 : 03:28:21
|
| Something like this??This works on Northwind but returns 2 recordsets.If you only want 1 rs then WHERE status >= 5CREATE PROC Sproc1 @EmpId intASSELECT EmployeeIdFROM Employees WHERE EmployeeId = @EmpIdEXEC Sproc2 @EmpId--End of Sproc1CREATE PROC Sproc2 @EmpId intASSELECT EmployeeIdFROM EmployeesWHERE EmployeeId > @EmpId--End of Sproc2EXEC Sproc1 5Andy |
 |
|
|
|
|
|