USE ClrPerfDB
GO

--Inproc
EXEC clr_ProdSched_MemLow_DataHigh_SO '04-01-2004',200,75
go

--Client
xp_cmdshell 'c:\ProdSchedClient.exe'
go

--T-SQL
DECLARE products_cursor CURSOR
   FOR
   SELECT PID FROM t_Products 
   -- WHERE PID = 1
OPEN products_cursor
DECLARE @pid int
FETCH NEXT FROM products_cursor INTO @pid
WHILE (@@FETCH_STATUS <> -1)
BEGIN
   EXEC ('EXEC tsql_ProductionScheduling''04-01-2004'', 200, ' + @pid)
   FETCH NEXT FROM products_cursor INTO @pid
END
DEALLOCATE products_cursor
go

--EXEC tsql_ProductionScheduling '04-01-2004',200,75
--go
