Wednesday, March 7, 2012

Error 0: Syntax error or Access violation

Hi,
I'm writing a stored procedure and when I click on the Check Syntax button its giving me the error in the subject. I'm not really sure whats wrong with this. Here is my Stored Procedure code. Any help wud be appreciated.


CREATE PROC CabsSchedule_Insert
{
@.JulianDatesmallint,
@.SiteCodesmallint,
@.CalendarDaysmallint,
@.BillPeriodsmallint,
@.WorkDaysmallint,
@.CalDayBillRcvd varchar(30),
@.Remarksvarchar(50)
}
AS
INSERT INTO CabsSchedule
(JulianDate, SiteCode, CalendarDay, BillPeriod, WorkDay, CalDayBillRcvd, Remarks)
VALUES
(@.JulianDate, @.SiteCode, @.CalendarDay, @.BillPeriod, @.WorkDay, @.CalDayBillRcvd, @.Remarks)

Thanks,check the datatypes of the columns and the values that you are trying to put into them. other than that i dont see anything else. you might also want tocheck this if you havent already.

hth|||Hi Dinakar,
Thanks for the reply. I got this thing to work. I'm not really sure how SQL Server behaves if I had an extra space inbetween my proc but removing the flower brackets ({) and
adjusting the CabsSchedule in the insert statement right beside the field names did the trick.


CREATE PROC CabsSchedule_Insert

@.JulianDatesmallint,
@.SiteCodesmallint,
@.CalendarDaysmallint,
@.BillPeriodsmallint,
@.WorkDaysmallint,
@.CalDayBillRcvd varchar(30),
@.Remarksvarchar(50)

AS
INSERT INTO
CabsSchedule(JulianDate, SiteCode, CalendarDay, BillPeriod, WorkDay, CalDayBillRcvd, Remarks)
VALUES
(@.JulianDate, @.SiteCode, @.CalendarDay, @.BillPeriod, @.WorkDay, @.CalDayBillRcvd, @.Remarks)

Thanks again!

No comments:

Post a Comment