Solved

Setting default datetime in MSSQL Enterprise Manager

Posted on 2006-06-21
2
370 Views
Last Modified: 2013-12-03
I have a datetime field in MSSQL.  I am using Enterprise Manager.  I would like to enter a default value for this field.  I try to enter (now())  or now()  or isNow()  but it will not take it.  How do I do it?
0
Comment
Question by:JuniorBee
2 Comments
 
LVL 20

Accepted Solution

by:
Sirees earned 350 total points
ID: 16955538
Instead use getdate()
0
 
LVL 27

Assisted Solution

by:ptjcb
ptjcb earned 150 total points
ID: 16955588
Yes, SQL Server does not have  a NOW function. Sirees is right - use GETDATE() or CURRENT_TIMESTAMP - they are the same thing. If you need UTC the GETUTCDATE() will give you that.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

760 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

21 Experts available now in Live!

Get 1:1 Help Now