Remote SQL Logging for TMG 2010

Setup SQL Server 2012 Logging for TMG on a different server according to this guideline here
However, the TMG is still not logging remotely.
After some investigation and testing, it was the name of the Database that we setup which is causing problem!
The name of the database contain a dash (ex: XXX-XXXX), which we could see and browse to in Management Studio.

But when I tested from the command line using sqlcmd, it would give me an error saying XXX is not recognise.
And it was the AHA moment that I realised it was something to do with the name!

sqlcmd is really helpful in this instance!

Here is an example using sqlcmd to list table's columns in a database:

> sqlcmd -S servername
1> use databasename
2> select column_name
3> from information_schema.columns
4> where table_name = 'Tablename'
5> go

More information about this useful utility can be found here.

If any reason you need to access the old records for the TMG in sqlexpress, here is how:
In management studio, servername: localhost\msfw 

Other tip: create any file with extension .udl, you would be able to use it to test Database connection in GUI