Yuvraj Jambhle

Yuvraj Jambhle

  • NA
  • 93
  • 8.3k

Want to insert milisecond data in SQL server 2012

Jun 23 2021 7:00 AM

Hello ,
I am trying to insert this value “2021-06-22 22:40:53.1855801” in SQL server but I got result in SQL server is like “2021-06-22 22:40:53.400”.

For this, I have use syntax.
DateTime cs_myDateTime = Convert.ToDateTime(rd[1].ToString());
string sql = “INSERT INTO ProcessValues([DeviceId],[TimeStamp]) Values(‘” + cs_myDateTime.ToString(“yyyy-MM-dd HH:mm:ss.nnnnnnn”) + “‘);


Answers (4)