Interview Questions Answers.ORG
Interviewer And Interviewee Guide
Interviews
Quizzes
Home
Quizzes
Interviews Databases Programming Interviews:BtrieveClipperData ModelingData StructuresDatabase AdministrationDatabase Administrator (DBA)Database AnalystDatabase DeveloperDB DevelopmentEDI/Data Integration ExpertFirebirdHierarchicalIBM DB2InformixJava DatabaseMariaDBMicrosoft Access DeveloperMongoDBMS SQL ServerMySQL ProgrammingNetworkNoSQLObject RelationalPostgrePostgreSQLProgressRDBMSRelationalSQLSQL AdministratorSQL and PL/SQLSQL Notification ServicesSQL server 2008SSRSStored ProcedureSybaseTeradata
Copyright © 2018. All Rights Reserved
MS SQL Server Interview Question:
What Are Date and Time Data Types in MS SQL Server?
Submitted by: AdministratorDate 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
* 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
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.