Category Archives: Microsoft Sql server

How to solve Exception : The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value with Entity Framework when calling SaveChanges

In order to fix this Issue you need to go on your EDMX file and View the Model.
So select the field interested and under it’s properties select “Computed” for the property StoreGeneratedPattern 


MS SQL How To Store a File into a blob field

If you need to store a file from your hard drive into a filed in MS Sql Server, you can run this code

UPDATE dbo.[Table] SET [Field]= (SELECT * FROM OPENROWSET(BULK N’C:fileName.PNG’,SINGLE_BLOB) rs)