Member_2_6478753
asked on
MS SQL
sql DATETIME DEFAULT getdate(), 'yyyy/MM/dd hh:mm:ss tt', 'en-US' ); ();
i want to make a default date when i insert new record in database
only i need to insert required field like username and password and automatically the datetime will be insert as default in each insertion
how i can do it ? in sql
i want to make a default date when i insert new record in database
only i need to insert required field like username and password and automatically the datetime will be insert as default in each insertion
how i can do it ? in sql
ASKER
i know this .. i want specific format in default datetime like this .. DEFAULT getdate(), 'yyyy/MM/dd hh:mm:ss tt', 'en-US' ); ()
ASKER
I've requested that this question be deleted for the following reason:
i have found the solution from sql server ebook
i have found the solution from sql server ebook
What is tt?
If you have found a solution, post it so others can benefit and then accept your own answer. Don't delete the question.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The date on sql server will be stored as Data type : datetime
than if you want to convert it to another format you should choose a function to convert to your format and the link below http://www.sql-server-helper.com/tips/date-formats.aspx
help you in choosing format type.
than if you want to convert it to another format you should choose a function to convert to your format and the link below http://www.sql-server-helper.com/tips/date-formats.aspx
help you in choosing format type.
ALTER TABLE myTable ADD DEFAULT (getdate()) FOR myColumn