supersal666
Programmer
Hi everyone, I have a stored procedure which populates some tables in a database. The error I get is
Procedure or function 'sAddCompletedQuestionnaire' expects parameter '@CompletedQuestionnaireResponseID', which was not supplied.[/color red]
the problem seems to be when trying to populate an identity column. The part in red is where it seems to give the error.
Procedure or function 'sAddCompletedQuestionnaire' expects parameter '@CompletedQuestionnaireResponseID', which was not supplied.[/color red]
the problem seems to be when trying to populate an identity column. The part in red is where it seems to give the error.
Code:
USE [MarketingQuestionnaire]
GO
/****** Object: StoredProcedure [dbo].[sAddCompletedQuestionnaire] Script Date: 11/06/2007 09:37:38 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[sAddCompletedQuestionnaire]
(
@CompletedQuestionnaireID varchar(50) OUTPUT
,@AuditDateID int
,@CompletedQuestionnaireResponseID int
)
AS
--***************************************************************************--
--************ Insert into dbo.ApplicationDate ******************************--
--***************************************************************************--
INSERT INTO dbo.ApplicationDate
(
AuditDate
)
VALUES
(
GetDate()
)
SELECT @AuditDateID = @@IDENTITY;
--***************************************************************************--
--************ Insert into dbo.CompletedQuestionnaire ***********************--
--***************************************************************************--
INSERT INTO dbo.CompletedQuestionnaire
(
CompletedQuestionnaireID
,AuditDateID
)
SELECT
Q1
,@AuditDateID
FROM
dbo.Satisfaction1
--***************************************************************************--
--************ Insert into dbo.CompletedQuestionnaireResponse ***************--
--***************************************************************************--
[COLOR=red]SELECT @CompletedQuestionnaireResponseID = @@IDENTITY[/color]
INSERT INTO dbo.CompletedQuestionnaireResponse
(
CompletedQuestionnaireID
,CompletedQuestionnaireResponseID
)
SELECT @CompletedQuestionnaireID
,@CompletedQuestionnaireResponseID
GO
DECLARE @CompletedQuestionnaireID bigint
DECLARE @AuditDateID int
DECLARE @CompletedQuestionnaireResponseID int
SELECT @AuditDateID
EXEC sAddCompletedQuestionnaire @CompletedQuestionnaireID OUTPUT ,@AuditDateID
SELECT @CompletedQuestionnaireID
--SELECT @CompletedQuestionnaireResponseID