I have this statement
EXEC [spProject_Update] @ProjectID = 496 ,@Name = 'Hangman Bollywood iPhone' ,@Description = '' ,@EstimateTime = 2674800000
I will get milliseconds in
How can I convert this to
datetime in SQL Server?
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It only takes a minute to sign up.Sign up to join this community
DATETIME is used to store an instant ("point in time") at a particular granularity (approx 300 milliseconds IIRC).
The value you wish to store is an interval (or is it a duration?) in milliseconds. SQL Server lacks an interval data type.
While both are temporal data they have quite different requirements. I suggest you use an numeric column (e.g.
INTEGER) to store the interval and use metadata (e.g. an appropriate name) to convey the fact the granularity is one millisecond.