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.
Download FREE SharePoint 2019 Installation PDF Guide
This FREE PDF contains, Steps by step guide to install SharePoint 2019 Preview, prerequisites, hardware and software new features. First impression to SharePoint Server 2019 new modern site, modern lists and modern document libraries.
You May Also like the Following SharePoint Online Tutorials: