The STDEVP function finds the standard deviation by using all of the values in a field.
In comaparison, the STDEV function only uses a portion, called a sample, of the values to calculate the standard deviation. There must be at least two values in the field or the standard deviation will not be calculated and a NULL value is returned.
SELECT STDEVP(Age) AS [DevAge]
FROM MediCarePatients
DevAge
19.21803
(1 row(s) affected)
This code finds the standard deviation of the age for all MediCare patients in a hospital and stores that information in 'DevAge'.