• Only tested on sql 2005 & 2008, so that may be an issue.

    The DBID() function with no argument returns the database id for the current db.

    The script should be run as is, without adding your database name.

    I accidently pasted the '- Hide quoted text -' comment at the top, make sure you've removed that too.