all groups > sql server programming > june 2006 >
You're in the

sql server programming

group:

Help with Stored Procedure


Help with Stored Procedure trevorjhughes NO[at]SPAM gmail.com
6/14/2006 8:56:07 PM
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
Re: Help with Stored Procedure Dave Frommer
6/15/2006 1:58:45 AM
Try removing the parenthesis arround the parameter list.

Stored Procedure calls do not use these.
[quoted text, click to view]

AddThis Social Bookmark Button