C
Chris
Hi,
I have a stored procedure that works perfectly in query
Analyser, but fails to return values in Access .adp
(Access2000 & SQL2000)
I have tracked down where the problem is occuring by
building the SP up 1 line at a time. See the following
code fragment:
CREATE PROCEDURE [dbo].[SP_T1]
(@DocumentID [Int] )
AS
DECLARE @RecCount int
SET @RecCount = 1
CREATE TABLE #TempDoc (DocumentID int)
CREATE TABLE #TempDoc1 (DocumentID int)
CREATE TABLE #TempDoc2 (DocumentID int)
----------------------------
--Other code would go here
-----------------------------
--Output of the SP
SELECT * FROM TBL_Document
This works correctly in both QA and .adp
I can select stored proc from the menu,refresh, double
click this SP,enter a parameter, and get the results of
the select statement. Exactly what I need!
If I add the next line to the stored proc so it reads:
CREATE PROCEDURE [dbo].[SP_T1]
(@DocumentID [Int] )
AS
DECLARE @RecCount int
SET @RecCount = 1
CREATE TABLE #TempDoc (DocumentID int)
CREATE TABLE #TempDoc1 (DocumentID int)
CREATE TABLE #TempDoc2 (DocumentID int)
--This extra line added
INSERT INTO #TempDoc1 VALUES (@DocumentID)
----------------------------
--Other code would go here
-----------------------------
--Output of the SP
SELECT * FROM TBL_Document
The SP continues to work in QA, but in Access I get
'The stored procedure executed correctly but did not
return records'
Does anyone know how I can get this to work correctly in
Access.
Thanks in Advance
Regards
Chris
I have a stored procedure that works perfectly in query
Analyser, but fails to return values in Access .adp
(Access2000 & SQL2000)
I have tracked down where the problem is occuring by
building the SP up 1 line at a time. See the following
code fragment:
CREATE PROCEDURE [dbo].[SP_T1]
(@DocumentID [Int] )
AS
DECLARE @RecCount int
SET @RecCount = 1
CREATE TABLE #TempDoc (DocumentID int)
CREATE TABLE #TempDoc1 (DocumentID int)
CREATE TABLE #TempDoc2 (DocumentID int)
----------------------------
--Other code would go here
-----------------------------
--Output of the SP
SELECT * FROM TBL_Document
This works correctly in both QA and .adp
I can select stored proc from the menu,refresh, double
click this SP,enter a parameter, and get the results of
the select statement. Exactly what I need!
If I add the next line to the stored proc so it reads:
CREATE PROCEDURE [dbo].[SP_T1]
(@DocumentID [Int] )
AS
DECLARE @RecCount int
SET @RecCount = 1
CREATE TABLE #TempDoc (DocumentID int)
CREATE TABLE #TempDoc1 (DocumentID int)
CREATE TABLE #TempDoc2 (DocumentID int)
--This extra line added
INSERT INTO #TempDoc1 VALUES (@DocumentID)
----------------------------
--Other code would go here
-----------------------------
--Output of the SP
SELECT * FROM TBL_Document
The SP continues to work in QA, but in Access I get
'The stored procedure executed correctly but did not
return records'
Does anyone know how I can get this to work correctly in
Access.
Thanks in Advance
Regards
Chris