Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004

    Unanswered: Adding a default value to a table

    I'm new to SQL server and am in the process of converting an Access Db to SQL.

    What I'd like to happen is for the current date and an Autonumber generated as soon as the user enters a value in another field. This was fairly straightforward in Access. When I try to set the default in design table (inSQL), the date() is not available. After a little research I came up with CREATE DEFAULT and Bind column commands, Global variables, etc.

    I have a couple of questions for anyone that might know:

    Is there an easier way than this to create default values in a table? AND,

    Would I also have to bind columns for Table lookups? For example, if I wanted a price to be returned after the product ID was entered (Automatic in Access if relationship/form setup properly), would I have to bind the column? Or would it happen automatically?

  2. #2
    Join Date
    Sep 2003
    you can use getdate() or current_timestamp instead of date()

    for "lookup" feature of access you can create calculated field.

Posting Permissions

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