Looks like the error about Firewall being an invalid object is because the script is connecting to SQL Server as a user with the wrong default database.
You need to either:
1) Modify the connection string to set the default database to your target database (Initial Catalog=dbname)
2) Modify the properties of the application login in SSMS to have the correct database as default.
Also make sure you explicitly specify the schema in your inline SQL, so dbo.Firewall (or whatever your schema is), especially important when using multiple schemas.
Post back if it works.
---Note to developers:
CAST(SUBSTRING(CAST(FLOOR(NULLIF(ISNULL(COALESCE(1,NULL),NULL),NULL)) AS CHAR(1)),1,1) AS INT) == 1
So why complicate your code AND MAKE MY JOB HARDER??!
Want to get the best help? Click here http://www.sqlservercentral.com/articles/Best+Practices/61537/ (Jeff Moden)
My blog: http://uksqldba.blogspot.com
Visit http://www.DerekColley.co.uk to find out more about me.