sql server programming:
Hello All I am trying to use a stored procedure to insert a record into an SQL Server 2000 database, however I have recieved the following error message: ODBC--call failed [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near '20060615',(#170) I am using a pass-thru query from MS Access and it is as follows: EXEC spInsertAppointments('20060615', '20060615', 374, '08:00:00', '17:00:00', '08:00:00', '17:00:00', 94, 0, 0, 'Some text', 'Some address', 'Test of the notes', 0, 0) This is being generated by VBA code. My stored procedure is as follows: CREATE PROCEDURE spInsertAppointments @Date datetime, @ActivityDate datetime, @StaffID int, @StartTime datetime, @EndTime datetime, @ActStartTime datetime, @ActEndTime datetime, @ActivityType int, @Shared bit, @Completed bit, @IntiatedBy varchar, @Address varchar, @Notes varchar, @lockPlanned bit, @isOvertime bit AS INSERT INTO tblAppointments ([Date],ActivityDate, StaffID, StartTime, EndTime, ActStartTime, ActEndTime, ActivityType, Shared, Completed, InitiatedBy, Address, Notes, lockPlanned, bIsOvertime) VALUES (@Date,@ActivityDate,@StaffID,@StartTime,@EndTime,@ActStartTime,@ActEndTime,@ActivityType,@Shared,@Completed,@IntiatedBy,@Address,@Notes,@lockPlanned, @isOvertime) GO If anyone could suggest where my problem is I'd really appreciate it. TIA Trevor
Try removing the parenthesis arround the parameter list. Stored Procedure calls do not use these. [quoted text, click to view] <trevorjhughes@gmail.com> wrote in message news:1150343767.907641.235130@c74g2000cwc.googlegroups.com... > Hello All > > I am trying to use a stored procedure to insert a record into an SQL > Server 2000 database, however I have recieved the following error > message: > > ODBC--call failed > [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax > near '20060615',(#170) > > I am using a pass-thru query from MS Access and it is as follows: > EXEC spInsertAppointments('20060615', '20060615', 374, '08:00:00', > '17:00:00', '08:00:00', '17:00:00', 94, 0, 0, 'Some text', 'Some > address', 'Test of the notes', 0, 0) > > This is being generated by VBA code. > > My stored procedure is as follows: > CREATE PROCEDURE spInsertAppointments > @Date datetime, > @ActivityDate datetime, > @StaffID int, > @StartTime datetime, > @EndTime datetime, > @ActStartTime datetime, > @ActEndTime datetime, > @ActivityType int, > @Shared bit, > @Completed bit, > @IntiatedBy varchar, > @Address varchar, > @Notes varchar, > @lockPlanned bit, > @isOvertime bit > AS > INSERT INTO tblAppointments > ([Date],ActivityDate, StaffID, StartTime, > EndTime, ActStartTime, ActEndTime, ActivityType, Shared, Completed, > InitiatedBy, Address, Notes, lockPlanned, bIsOvertime) > VALUES > (@Date,@ActivityDate,@StaffID,@StartTime,@EndTime,@ActStartTime,@ActEndTime,@ActivityType,@Shared,@Completed,@IntiatedBy,@Address,@Notes,@lockPlanned, > @isOvertime) > GO > > If anyone could suggest where my problem is I'd really appreciate it. > > TIA > Trevor >
Don't see what you're looking for? Try a search.
|