I have the following stored procedure, it works fine except that when returns all the results it will start over and create another window, it is looping over and over creating table after table with the same results. What could be causing this?
USE [HRLearnDev]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[COL_Run_DOM_Parameters]
@StartDate varchar (50),
@EndDate varchar (50)
AS
SET NOCOUNT ON
SELECT *
FROM dbo.COL_V_GEMS_DOM_FCT
WHERE REC_EFF_STT_DT BETWEEN @StartDate and @EndDate
ORDER BY REC_EFF_STT_DT DESC
EXECUTE COL_Run_DOM_Parameters @StartDate = "2010-03-05", @EndDate = "2011-06-11"