If I don't care about less than seconds, what should be the recommended type to store my datetime values in sql-server 2005, is it datetime or smalldatetime or else?
datetime vs smalldatetime
7.6k Views Asked by Shimmy Weitzhandler At
3
There are 3 best solutions below
0
MartW
On
If you don't care about seconds, dates earlier than 1900 or later than 2079, smalldatetime will be fine :) Otherwise you're better off with datetime.
http://msdn.microsoft.com/en-us/library/aa258277(SQL.80).aspx
Related Questions in VISUAL-STUDIO
- NuGet - Given a type name or a DLL, how can I find the NuGet package?
- Exception thrown at 0x0131EB06 Visual Studio
- Visual Studio 2015 Cordova Plugin Add Fail
- Cannot find InvalidCastException in C# Application
- generating C# code file during Visual Studio build
- Can I deploy multiple instances of my application on the same windows phone?
- Close the Solution Explorer window
- How to generate entity framework code-first migrations without using the package manager console?
- Implementing callback function for dialog-based application
- VB.net: How to make original variable value fulfill 2 statements?
- DLL being marked as DELETEPENDING
- String tokenizing in Visual Studio C++
- How to use "Multicharts Studies" in Visual Studio 2013?
- Programs Will Not Run In Visual Studio
- VB.Net: Display total when check boxes are checked
Related Questions in SQL-SERVER-2005
- sqlsrv_query doesn't return false on faulty T-SQL query
- PHP error connecting to MS SQL 2005 using CodeIgniter
- SQL Insert Date Mystery on 2012 from 2005
- SQL Server 2000 query conversion
- How to compare two date in SQL Server 2005?
- Different SELECT's for an INSERT INTO
- Selecting from a column with Ampersand(&)
- Get Parent and grand parents of a particular child
- UPDATE after INSERT for potentially multiple rows - not working
- Is there a way to re-write this SQL query using a WITH clause or any other CTE that might be even better?
- Get Active Directory Name From SQL User ID
- vb.net auto update datagridview when database change
- sql query to join and concat values
- UNION ALL on 2 tables select with Cases
- LEFT JOIN on multiple columns with unwanted duplicates
Related Questions in DATETIME
- Python datetime.now() with timezone
- Create a list of sequential monthly dates in PHP given initial date and quantity
- DataTable RowFilter on Time component of DateTime column
- Joda DateTime Json date format issue
- how to create folder and file with datetime in wpf application
- String concatenation with padded integers
- What is the correct DateTime format in WebSQL to perform date comparison queries?
- how to get the time interval of a date and a datetime displayed as day,hour, min,seconds in sql
- DateTime.Now.ToString("HH:MM") allways gives 20:06
- How can I get the ctime and/or mtime of a file in Python including timezone?
- add time (char(8)) to date column
- MyBatis cannot work with joda DateTime?
- PHP Fatal error: Call to a member function format() on boolean
- Use DateTime format in a class but restrict time tokens
- Modify records to account for correct priority and order between two systems
Related Questions in SMALLDATETIME
- Sql Server Query Date Issue
- datetime vs smalldatetime
- SQL Server 2005: converting smalldatetime to varchar behaves differently in view and 'normal' query
- T-sql SmallDateTime add day when time passed 23:30
- SQL Server import - smalldatetime error
- Convert datetime to smalldatetime in sql insert query
- Handling Dates while copying from Excel to SQL server database table in Talend
- Vb select using dates
- No date/time in Select statement, getting: Conversion failed when converting character string to smalldatetime data type
- 30 second offset with smalldatetime comparison on SQL
- MSSQL PreparedStatement for smalldatetime returns wrong result
- JDBC encoding to sql server smalldatetime
- Convert timestamp (int) to smalldatetime (t-sql)
- Return extra ".0" when reading "smalldatetime" column with PreparedStatement
- check for null date in CASE statement, where have I gone wrong?
Related Questions in SQL-TYPES
- What is a portable SQL data type for storing boolean values?
- Primary Key as domain username AND userID?
- Is it possible to define bit column in sqlite?
- Sql Spatial Type, Code First migration and Azure DB
- Varchar Encoding in MySQL
- MySQL alter table - changing a TINYINT to a SMALLINT
- Set decimal(16, 3) for a column in Code First Approach in EF4.3
- Automapper value type to SqlType conversions
- Invalid data type while using user defined table type
- Decimal(19,4) or Decimal(19.2) - which should I use?
- MySQL alternative to PostgreSQL's custom data type (and domain)
- What are SQL Server data-types mapped to by default in ADO.NET?
- datetime vs smalldatetime
- CREATE FUNCTION for <> T-SQL and CLR types for return value do not match
- using SqlGeography types in C# client-side
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
smalldatetime has a resolution down to one minute, so if that resoulution is OK for you, smalldatetime is 50% smaller (4 bytes vs. 8 bytes) so is preferred.
See http://karaszi.com/the-ultimate-guide-to-the-datetime-datatypes for a good overview.