Results 1 to 3 of 3

Thread: Timestamping

  1. #1
    Join Date
    Jun 2004

    Unanswered: Timestamping

    Hello. I have created three stored procedures that insert data into a table and updates that table, respectively. I have added a new column to my table, StartTime, which i want to timestamp (Set and enter the exact time) that the user clicks the submit button on my web page. This value should be entered into the database. Can anyone help me get started with this?

  2. #2
    Join Date
    Aug 2003
    Kingston, Ontario
    Just make GetDate() the default for the column. As soon as a record is inserted the date/time will be filled in by SQL.

  3. #3
    Join Date
    Jun 2003
    Provided Answers: 1
    That will handle inserts, but not updates.

    You will need a trigger to update the datetime value if you want the table to handle it automatically. Otherwise, let your stored procedure take care of it.

    Normally I like to put these rules in the database, but your description of it relating to the exact time that the user clicks the Submit button makes me wonder it your web page shouldn't be setting and submitting the value.
    If it's not practically useful, then it's practically useless.

    blindman "sqlblindman"

Posting Permissions

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