Jul 29, 2010

percentile calculation in t-sql

select max(PERCENT_OUTBOUND_CALLS) from (
SELECT top 20 PERCENT PERCENT_OUTBOUND_CALLS FROM scorecard_outlier ORDER BY PERCENT_OUTBOUND_CALLS asc )a

Jul 19, 2010

SQL DB restore from MDF file

EXEC sp_attach_single_file_db @dbname = 'HealthCheck',
@physname = 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\HealthCheck.mdf'