Interviewer And Interviewee Guide

MS SQL Server Interview Question:

What Are Date and Time Data Types in MS SQL Server?

Submitted by: Administrator
Date and time data types are used to store an instances of calendar dates and times. SQL Server 2005 supports the following date and time data types:

* DATETIME - Date and time values stored in 8 bytes with 4 bytes for the date and 4 bytes for the time. DATETIME values are in the range of January 1, 1753 to December 31, 9999 with a precision of 3.33 milliseconds.
* SMALLDATETIME - Date and time values stored in 4 bytes with 2 bytes for the date and 2 bytes for the time. SMALLDATETIME values are in the range of January 1, 1900 to June 6, 2079 with a precision of 1 minute.

Note that SQL Server does not support DATE and TIME data types separately. Here are some good examples of date and time values:

PRINT '2107-05-19 22:52:51.607'; -- DATETIME
PRINT '2007-05-19 22:52:00'; -- SMALLDATETIME
GO

Submitted by: Administrator

Read Online MS SQL Server Job Interview Questions And Answers
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.