Solved

date field sql server --- set to automatically create todays date when record added

Posted on 2011-02-11
2
595 Views
Last Modified: 2012-05-11
I have a date created (field) in a users table. How would I make it so that when a record is added to the table it would be automatically the current date/time.

What would i put in default value or binding?
0
Comment
Question by:vbnetcoder
2 Comments
 
LVL 9

Accepted Solution

by:
sshah254 earned 250 total points
Comment Utility
http://msdn.microsoft.com/en-us/library/ms174979.aspx

constant_expression
Is a constant, NULL, or a system function that is used as the default value for the column.

So GETDATE() should work.

Ss
0
 

Author Closing Comment

by:vbnetcoder
Comment Utility
ty
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
This video discusses moving either the default database or any database to a new volume.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now