• Two more great tips, thanks.

    BTW to run the query, you need to enable 'xp_cmdshell' in Surface Area Configuration.