I have setup an Include file, a procedure that is called by other procedures. I am running into the following problem:pr_TestProc1:SET NOCOUNT ONCREATE TABLE #Temp (TestID char(5), TestPerd datetime, TestValue decimal(18,5) Null)INSERT INTO #Temp (TestID, TestPerd, TestValue)SELECT ChemicalID, ChemPeriod, ChemUsageFROM tblUsagesWHERE ChemPeriod = '1/1/2006'INSERT INTO #Temp (TestID, TestPerd, TestValue)SELECT 'TESTNEW', TestPerd, Sum(TestValue)FROM #Temp/* WHERE TestID <> 'TESTCHEM' */GROUP BY TestPerdSELECT TestID, TestValue FROM #Temp
pr_TestProc2:SET NOCOUNT ONCREATE TABLE #tmp (TestID char(5), TestValue decimal(18,5))INSERT INTO #tmpExec pr_TestProc1SELECT TestID, TestValueFROM #tmp
Running pr_TestProc2 gives me the message:Stored Procedure ran successfully but no records were returnedIf I include the following line, it works:WHERE TestID <> 'TESTCHEM'The 'TESTCHEM' TestValue is null, and that seems to create problems with the 'Exec' in a Group By situation.I don't quite understand why I can run the pr_TestProc1 with correct results, whereby the pr_TestProc2 gives no results.