I was set up using starnge assigment where I need to convert 40 table columns from datetime2 to datetime.
this is the date and time format that I have in my database. 2007-11-12 00:00:00
contains over 90,000 entries
Please, help
datetime
SELECT * FROM MyTable WHERE MyColumn <'1753-01-01'
UPDATE MyTable SET MyColumn = '1753-01-01' WHERE MyColumn <'1753-01-01'
ALTER TABLE MyTable ALTER COLUMN MyColumn DATETIME
i.e. just rediculos, datetime2 is more accurate, it has a larger daterange and takes up as many bytes (8).
here is the code for mssql:
alter table tablename alter column colname datetime
Source: https://habr.com/ru/post/1494941/More articles:How to unzip a file and copy it to a specific location using 7zip? - powershellhttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1494937/mapping-factors-to-colors-in-heatmap2&usg=ALkJrhh6lBoBO8PAM93wM0q6JD2yuYmgCQAccess data from .XML file using Matlab - xmlCSS3 Animation - Delay, Stop, and Play - cssExtracting a single file from a zip archive without iterating over an entire list of names in Python - pythonPossible error in RavenDB EmbeddableDocumentStore - linqHow to identify a DirectX shader model higher than v3 supported by a graphics card? - directxDouble fadeIn using jQuery - javascriptLibrary for collecting information about PC / OS hardware - c ++Git report merge file is deleted if it is not - gitAll Articles