I have this SQL statement
INSERT housingSurvey ([nameID], [houseID], [jobID], [Active], [comment], [needsMaintenance], [lastUpdateDate)
VALUES (@NAMEID, @HOUSEID, @JOBID, 1, @DUEDATE, @COMMENT, NULL, @LASTUPDATEDATE)
I tried this stored procedure, but I don’t get the current date.
CREATE PROCEDURE housingSurveyS(
@NAMEID INT,
@HOUSEID INT,
@JOBID INT,
@COMMENT BIT,
@DUEDATE NVARCHAR,
CURRENTTIME)
AS
BEGIN
INSERT INTO housingSurvey(
[nameID],
[houseID],
[jobID],
[Active],
[comment],
[dueDate],
[needsMaintenance],
[lastupdatedate])
VALUES (
@NAMEID,
@HOUSEID,
@JOBID,
1,
@COMMENT,
@DUEDATE,
NULL,
@LASTUPDATEDATE)
END
Could you please take a look at what I did wrong. Thanks
UPDATE
I changed it CURRENTTIME to DATETIME as parameter to insert current date to [lastupdatedate]… it still doesn’t work…
Are in the wrong order when related to the order of fields defined in the
INSERTs statements field list, switch them around.Edit