Get your database details from SQLSystem Class in MSD Axapta

//Check out the other methods of the SQLSystem class

 static void SqlSystem(Args _args)  
 {  
 SqlSystem SqlSystem = new SqlSystem();  
 ;  
 info(SqlSystem.loginServer() + ' ' + SqlSystem.loginName());  
 }