Currently using MS SQL2000 and have a stored procedure that accepts 3 parameters...
@intYear,
@intPeriod,
@intCostCentre.
I've a table that is full of costcentre nominal codes, and want to run the stored procedure for each cost centre in the table.
For example...
SELECT mySP @intYear=2005, @intPeriod=5, @intCostCentre=SELECT costCentre FROM costCentreTable
Obviously that doesn't work but I'm sure I've read somewhere about using the IN statement to achieve this.
Any ideas?
TIA
@intYear,
@intPeriod,
@intCostCentre.
I've a table that is full of costcentre nominal codes, and want to run the stored procedure for each cost centre in the table.
For example...
SELECT mySP @intYear=2005, @intPeriod=5, @intCostCentre=SELECT costCentre FROM costCentreTable
Obviously that doesn't work but I'm sure I've read somewhere about using the IN statement to achieve this.
Any ideas?
TIA