select name from sys.Databases WHERE name NOT IN ('master', 'tempdb', 'model', 'msdb'); /* removing the name of sys db*/