Today, I am going to describe how to generate random value for DATETIME field within a given range. This is very useful specially for generating test data. For this, we will use couple of built-in functions like: DATEDIFF DATEADD RAND ROUND Random DATETIME Value DECLARE @startDate DATETIME -- start date DECLARE @endDate DATETIME -- end …
The post Random value for DATETIME column appeared first on IT Tutorial.