Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2011-02-11
2
Medium Priority
?
608 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 1000 total points
ID: 34875215
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
ID: 34875261
ty
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

886 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