TSQL Code for DBA