Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Default for datetime column
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01503623
Message ID:
01503624
Vues:
58
This message has been marked as the solution to the initial question of the thread.
>Hi,
>
>Is it possible to specify default for DateTime column of SQL database? Ideally I would like the default to be the current date and time. Please let me know. TIA.

you can supply a constraint that sets the default to GETDATE()

You can do this in SSMS easily if you open the table in design mode and click on the column - there is a section for default.

Update - here's an example -- http://www.mssqltips.com/tip.asp?tip=1425
____________________________________

Don't Tread on Me

Overthrow the federal government NOW!
____________________________________
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform