Skip to content

Instantly share code, notes, and snippets.

@yinchuan
Created August 20, 2012 08:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yinchuan/3402124 to your computer and use it in GitHub Desktop.
Save yinchuan/3402124 to your computer and use it in GitHub Desktop.
SQL Server中随机生成指定范围的日期和时间
DECLARE @insert_date datetime;
SET @insert_date = GETDATE();
SET @insert_date = @insert_date + rand() * 1.0/24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment