Need to edge out the competition for your dream job? Train for certifications today.
CREATE TABLE #test
DateCol DATE CONSTRAINT DF_Test_DateCol DEFAULT ( GETDATE() )
Open in new window
In this technical webinar, AlgoSec will present several examples of common misconfigurations; including a basic device change, business application connectivity changes, and data center migrations. Learn best practices to protect your business from attack.
CREATE TABLE #tmp (id int, dt date DEFAULT CAST(GETDATE() as date))
INSERT INTO #tmp (id) values (1), (2), (3)
SELECT * FROM #tmp
GETDATE() is actually Sybase syntax carried over to SQL and is not ansi-compliant, so it may be being phased out by MS.
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.