Does SqlDbType.DateTime store seconds?

using System.Data;
using System.Data.SqlClient;

I use SqlCommand cmd.Parametersto SqlDbType.DateTimeto create a record in the database.

Seconds are not stored in the database. The field in db is of type datetime.

Do I need to do something to save seconds, or SqlDbType.DateTimenot?

+3
source share
2 answers

SqlDbType.DateTimemaps to the SQL data type DATETIME, which is more precisely 3.33 milliseconds. It looks like you can put your values ​​in a field SMALLDATETIMEon a SQL server, which is accurate to the minute. SqlDbType.DateTimewould be the right choice to use with DATETIMEand SMALLDATETIME.

+3
source

SQL Server DateTime ( , .003.007 ..)

Smalldatetime, , , : 00. , smalldatetime.

http://msdn.microsoft.com/en-us/library/ms182418.aspx

0

Source: https://habr.com/ru/post/1711516/


All Articles