How to generate numbers with a normal distribution in SQL Server

Mel picture Mel · May 16, 2012 · Viewed 7.7k times · Source

I'm trying to seed some data, is there anyway to generate numbers in SQL Server that follow a normal distribution curve?

Like: I will specify the mean, the standard deviation and the count and I get a list of numbers back?

Answer

AaronConnell picture AaronConnell · Nov 20, 2013

random normal distribution

UPDATE TABLE 
SET COLUMN = CAST(SQRT(-2*LOG(RAND()))*SIN(2*PI()*RAND(CHECKSUM(NEWID())))as decimal(5,3))    
from TABLE