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
- The current .NET SDK does not support targeting .NET Core 6.0. Brand new WPF Project VS Community 2022 17.9.5
- Dotnet Run is not working but the application is running in Visual Studio
- Is there a way to support Tailwind @apply in Visual Studio?
- How can I eliminate compile warnings using ZLib in Visual Studio
- C++(or Visual Studio) saving the file will not preserve the original file contents
- VS Community 2022 cannot install dotnet-ef when i try to publish
- Visual Studio 2022 convert spaces to tabs on checkout and back to spaces on checkin
- What should I do if Visual Studio has a restriction on creating files with a long name or a long path to these files?
- Command line error D8036 - not allowed with multiple source files with node-gyp and VS2022
- Migrate Old VS 2015 .suo file to the New VS 2022 DocumentLayout.json
- How to make one executable visual studio, that users can run?
- Use tabs instead of spaces in .csproj file in Visual Studio 2022
- Unity - scrollview/dragging breaks after specific scene inactivity
- How to make Visual Studio 2022 project launch Windows Terminal instead of PowerShell?
- Why is 'EDITBIN /STACK:2097152 w3wp.exe' cmd is giving me an LNK1342 error?
Related Questions in SQL-SERVER-2005
- Sqlcmd can connect to old SQL Server 2005, but connection string pyodbc with Driver 18 from Microsoft does not work
- Possible reasons for an SSIS conditional split into the same destination table?
- Replace occurrences of characters in a string
- What does the value 30 indicate in the type column in the MSrepl_commands table?
- What is the fastest way to extract data from SQL Server 2005 using PowerShell 7?
- Auto applied migrations using EF Core 7.0.14
- Need a SQL Query for Getting matched and not matched Records
- SQL Server query returns multiple line results instead of returning 1 line
- Write error with spark.write against SQL Server table (via JDBC Connection)
- Extract data using multiple conditions for the column value?
- MS SQL SERVER 2005 temp db log file size is increasing
- How to get the sum of a column for the current month?
- Cannot connect to server - An existing connection was forcibly closed by the remote host
- MS SQL Sort Alphanumeric values (1, 2, 3, 5, 6, 7, 9, 10, 4a, 8a, 4b, 8b)
- Is there a way to Manually unlock the Opentext Exstream Design Database?
Related Questions in DATETIME
- I wrote this time displaying FLUTTER app, How can I improve it?
- How to convert pandas series to integer for use in datetime.fromisocalendar
- JSON file of 7000 meetings in multiple timezones and Flatlist
- Intl.DateTimeFormat() - return weekday as number?
- I'd like to create a custom time zone converter, any pointers?
- How set weekday datetime?
- ValueError: setting an array element with a sequence. Trying to make a Skymap in Python
- Different X axes with Plotly's make_subplots
- Error when converting datetime from UTC to Brasilia datetime in Power BI
- Problem converting time series df from chr to date using as.POSIXct
- How to supress naive datetime warning in django
- How to find rows that fall within time range from a dataframe?
- Timedelta error - AttributeError: type object 'datetime.datetime' has no attribute 'timedelta'
- How to convert "Tue Feb 27 2024 16:35:30 GMT+0800" String to ZonedDateTime type
- react apex charts x axis labels and tool tip showing different times instead of actual PST time
Related Questions in SMALLDATETIME
- ASP.NET vb.net "The conversion of char data type to smalldatetime data type resulted in an out-of-range smalldatetime value."
- No date/time in Select statement, getting: Conversion failed when converting character string to smalldatetime data type
- select smalldatetime between two strings
- Assigning 31.12.2099 to an OLE DB parameter of type DBTimeStamp doesnt work after changing to MSOLEDBSQL
- T-sql SmallDateTime add day when time passed 23:30
- Trigger date conversion fails
- Return extra ".0" when reading "smalldatetime" column with PreparedStatement
- Getting Date Range
- How to convert "01/30/2018 02:29:23 PM" into smalldatetime format? I am using MSSQL for my application and the column is smalldatetime format
- SQL Server 2008 : issues with date conversion
- Convert datetime to smalldatetime in SQL stored procedure that preserves the time?
- MSSQL PreparedStatement for smalldatetime returns wrong result
- How to insert smalldatetime
- 30 second offset with smalldatetime comparison on SQL
- Convert timestamp (int) to smalldatetime (t-sql)
Related Questions in SQL-TYPES
- Postgres plsql return one column from table with dynamic type
- ORACLE : How to add a nested table to an existing type
- PLSQL aggregation function using type object PARALLEL_ENABLE AGGREGATE
- Postgresql Jsonb Java Hibernate 6 JdbcTypeCode
- Getting error when retrieving Spatial Data from my database
- MySQL alternative to PostgreSQL's custom data type (and domain)
- Avoid error out of range SQL during database migration
- Converting SQL type to PLSQL collection / converting one collection type to another
- using SqlGeography types in C# client-side
- SQL Server compatibility creates issue
- Assign ref variable value oracle
- Is There a Way to Convert System.Data.SqlTypes.SqlBinary of Datatable To Type System.Byte[]?
- DataTable not populating a datatype fully in sql server
- create a PySpark Schema for a tuple composed of a list and an array
- Insert data into user-defined type elements of a table in postgresql
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 # Hahtags
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.