Had an instance the other day where I needed to connect to the database for WSUS on Server 2012R2, but I actually had no idea how to do it! Luckily, we have the internet at our disposal.
First things first (although quite obvious) we are going to need to make sure that SQL Server Management Studio is installed on the WSUS box, available to download from Microsoft for free from here. Once you have that installed, open it up as administrator and connect to the following using Windows Authentication:
Select connect and wa-lah you should get connected assuming you are an administrator. You will find a database named SUSDB, this is your WSUS database.