In this post, we will discuss how we can insert default DateTime to a column in SQL server 2008 in management studio as well as by using query.
In my previous posts, we have discussed
As we know through the use of GETDATE() function we can get the current date time in SQL server 2008.
Below is the query to add default date value to a column.
CREATE TABLE Employees
EmpId int NOT NULL PRIMARY KEY,
Name varchar(50) NOT NULL,
JoiningDate DateTime NOT NULL DEFAULT GETDATE()
Check the below figure to add default value using Management Studio.
You May Also like the Following SharePoint Tutorials: