In the sql server 2005 table, I have a date column in the format dd / mm / yyyy. But everything on the 2008 sql server is yyyy-mm-dd.
Where can I change the format of dates stored in 2008 compared to 2005?
Thanks,
Datetime types are always physically stored in the same format. It uses 8 bytes, the first 4 bytes are ints that store days before or after the base date 1/1/1900, and the 2nd 4 bytes are ints that represent the number 1/300 of a second from midnight.See here for for more information - http://msdn.microsoft.com/en-us/library/ms187819(SQL.90).aspx .
When you are viewing data, you can change the way data is presented using SET DATEFORMAT or using CONVERT . Technet has a good list of datetime functions to use with T-SQL.
SELECT CONVERT(DATETIME,'13/04/2006',103)
Read more about date and time formats here .
, DateTime , Sql, .Sql Management Studio, Database, Properties, Options, Collation., , .
, , , . , , . SQL, , , "", " "., .
Here are some other good links to crazy things people expect to do with datetime "strings":
http://sqlblog.com/blogs/aaron_bertrand/archive/2009/10/16/bad-habits-to-kick-mishandling-date-range-queries.aspx
And some more additional information about date / time types:
http://www.karaszi.com/SQLServer/info_datetime.asp
Source: https://habr.com/ru/post/1718473/More articles:Linux user space hardware recognition - linuxHow to build an HQL query that connects subtitles marked with LAZY automatically? - javaCreate a new image from a cropped image - c #Какой контроль проверки asp.net я должен использовать? - c#How to simulate ThisPresentation in PowerPoint VBA - vbaResetting the application pool will automatically close all database connections? - resetHow to find all the strings of a brotherhood? - algorithmmore lucen than javaprimary key auto-increment and replication - mysqlОбнаружение горизонтальных прокруток в UIScrollView с помощью вертикальной прокрутки - iosAll Articles