TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
anil john
NA
156
210.5k
Incorrect syntax near the keyword 'select'
Dec 17 2012 2:03 AM
Gtting h error:
Msg 156, Level 15, State 1, Procedure sp_DcPymentnsert, Line 16
Incorrect syntax near the keyword 'select'.
Msg 156, Level 15, State 1, Procedure sp_DcPymentnsert, Line 18
Incorrect syntax near the keyword 'select'.
Msg 156, Level 15, State 1, Procedure sp_DcPymentnsert, Line 20
Incorrect syntax near the keyword 'select'.
my pocedure
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: Anil K John
-- Create date: 1/12/2012
-- Description: Daily collection Payment
-- =============================================
CREATE PROCEDURE sp_DcPymentnsert
(
@iChitId int,
@iRegId int,
@fPaidAmount float,
@dPaidate datetime
)
AS
BEGIN
declare @fInstmount float
set @fInstmount=select fInstmount from tblChitInstalments where iChitId=@iChitId and iInstNo=(select max(iInstNo) from tblDCPayment where ichitId=@iChitId)
declare @dInstDate datetime
set @dInstDate=select dInstDate from tblChitInstalments where iChitId=@iChitId and iInstNo=(select max(iInstNo) from tblDCPayment where ichitId=@iChitId)
declare @Balance float
set @Balance=select fInstmount-fPaidAmount from tblDCPayment where iChitId=@iChitId and iRegId=@iRegId
INSERT INTO tblDCPayment(iChitd,iRegId,iInstNo,fInstAmount,dInstDate,fPaidAmount,fBalance,dPaidDate)
VALUES(@iChitId,@iRegId,'1',@fInstmount,@dInstDate,@fPaidAmount,@Balance,@dPaidate)
END
GO
Reply
Answers (
2
)
How many types of triggers in sql server 2008
How To Disable Open & Modify Tasks On Right Click To Table.