Sunday, March 11, 2012

DateTime error in stored procedure

Hi;

I have a stored procedure simply adds userid,logintime and status to db but I have an error when running procedure can you help me please??

Create Procedure AddLog
(
@.User char(10),
@.DLogon DateTime(8),
@.Status bit
)
As
Insert Into Log(UserID,LogInTime,Online)
Values(@.User,DLogon,Status)

ERROR:

Server: Msg 128, Level 15, State 1, Procedure AddLog, Line 9
The name 'DLogon' is not permitted in this context. Only constants, expressions, or variables allowed here. Column names are not permitted.You are missing a couple of @. signs. Should be:


Create Procedure AddLog
(
@.User char(10),
@.DLogon DateTime(8),
@.Status bit
)
As
Insert Into Log(UserID,LogInTime,Online)
Values(@.User,@.DLogon,@.Status)

No comments:

Post a Comment