What's wrong with this INSERT stored procedure (1 Viewer)

Khalid_Afridi

Registered User.
Local time
Today, 12:17
Joined
Jan 25, 2009
Messages
491
Kindly see the SQL stored procedure which is simple INSERT statement on a single table 'tblSOF'

Code:
-- ================================================
-- Template generated from Template Explorer using:
-- Create Procedure (New Menu).SQL
--
-- Use the Specify Values for Template Parameters 
-- command (Ctrl-Shift-M) to fill in the parameter 
-- values below.
--
-- This block of comments will not be included in
-- the definition of the procedure.
-- ================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE InsertINTO_tblSOF_sp
-- Add the parameters for the stored procedure here
@SOFID int, @ContractNo nvarchar(15), @SOFNo nvarchar(10), @WONo int, @WORefType nvarchar(50), @WORef nvarchar(50), @InvoiceID int,
@OrgCode nvarchar(50), @Sec nvarchar(50),@SOFDate datetime ,@CommenceDate datetime,@LDPerDay money ,@DurationDays int,
@CompletionDate datetime, @TxtIncrmnt int, @TypeofWO nvarchar(50) ,@ActCompletionDate datetime, @DescriptionOfWork nvarchar(100),
@Location nvarchar(50), @Status nvarchar(50), @StatusDate datetime, @AccStringID int, @SOFValue money, @LDApplied int, @PartialPayment bit,
@Retention bit, @Percent money, @LogRegID int, @RecordedBy nvarchar(50)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

-- Insert statements for procedure here
INSERT INTO [tblSOF]
 ([SOFID]
 ,[ContractNo]
 ,[SOFNo]
 ,[WONo]
 ,[WORefType]
 ,[WORef]
 ,[InvoiceID]
 ,[OrgCode]
 ,[Sec]
 ,[SOFDate]
 ,[CommenceDate]
 ,[LDPerDay]
 ,[DurationDays]
 ,[CompletionDate]
 ,[TxtIncrmnt]
 ,[TypeofWO]
 ,[ActCompletionDate]
 ,[DescriptionOfWork]
 ,[Location]
 ,[Status]
 ,[StatusDate]
 ,[AccStringID]
 ,[SOFValue]
 ,[LDApplied]
 ,[PartialPayment]
 ,[Retention]
 ,[Percent]
 ,[LogRegID]
 ,[RecordedBy])
     
 VALUES
 (@SOFID
 ,@ContractNo
 ,@SOFNo
 ,@WONo
 ,@WORefType
 ,@WORef
 ,@InvoiceID
 ,@OrgCode
 ,@Sec
 ,@SOFDate
 ,@CommenceDate
 ,@LDPerDay
 ,@DurationDays
 ,@CompletionDate
 ,@TxtIncrmnt
 ,@TypeofWO
 ,@ActCompletionDate
 ,@DescriptionOfWork
 ,@Location
 ,@Status
 ,@StatusDate
 ,@AccStringID
 ,@SOFValue
 ,@LDApplied
 ,@PartialPayment
 ,@Retention
 ,@Percent
 ,@LogRegID
 ,@RecordedBy)
        
GO

I am stumped with the following error.

Error: Msg 102, Level 15, State 1, Procedure InsertINTO_tblSOF_sp, Line 80
Incorrect syntax near ')'.
 

namliam

The Mailman - AWF VIP
Local time
Today, 11:17
Joined
Aug 11, 2003
Messages
11,695
Just guessing here... But dont you need a ; to complete the Insert statement?
 

Khalid_Afridi

Registered User.
Local time
Today, 12:17
Joined
Jan 25, 2009
Messages
491
Just guessing here... But dont you need a ; to complete the Insert statement?

it was not the issue of missing of ; semi colon. The problem was the BEGIN...END block in SQL STORED PROCEDURE.
I was missing the END statement at the end of my Stored procedure, anyhow it is solved.
 

Users who are viewing this thread

Top Bottom