Results 1 to 2 of 2

Thread: smalldatetime

  1. #1
    merot Guest

    Default smalldatetime

    how do i declare a date variable in a stored procedure?<BR>this is the procedure i have but it said that there are errors<BR>near the "Default" thanx<BR><BR>CREATE PROCEDURE sp_InsertReview<BR><BR>(<BR>@idMovie int,<BR>@chrMovieName varchar(225),<BR>@chrCategory varchar(100),<BR>@chrUserName varchar(255),<BR>@chrSubject varchar(225),<BR>@txtDescription text,<BR>@chrRating varchar(225),<BR>@datedCreated smalldatetime default getdate()<BR>)<BR><BR><BR>AS<BR><BR>insert into Reviews(idMovie, chrMovieName, chrCategory, chrUserName, chrSubject, txtDescription, chrRating, dateCreated)<BR>values(@idMovie, @chrMovieName, @chrCategory, @chrUserName, @chrSubject, @txtDescription, @chrRating, @dateCreated)<BR><BR>select idReview = @@identity<BR>GO

  2. #2
    Nils Bilhorn Guest

    Default RE: smalldatetime

    The syntax should be, e.g.<BR><BR>@datedCreated smalldatetime = default null<BR><BR>As far as I know it is only possible to use a constant (or null) when declaring the default value<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts