I am fairly new to C# and Microsoft SQL Server but I wrote a code in Visual Studio using C# that will read in a .csv
file, parse the data and place the correct values in the correct columns of a Microsoft SQL Server table.
The issue I am having is that the dates being sent to me are epoch dates. I know that my number is counting the seconds from 12/31/1899 11:59pm. Right now, I have it just being inputted into my table as a number.
For example: 3673900800. I was wondering if there was a way to change my table definition in my table in order for it to automatically convert that number into a date.
For example, setting the data type as a smalldatetime
. I did try this, but it didn't work. Do I have to convert the number in my code. before sending it to the SQL table, or is there a way to have the server automatically convert it