The real simple solution formust declare the variable '@hostname'
this error comes about because your sql server is set to be case sensetive. in the script the variable declared is @hostName not @hostname note the difference in capital N and n. the solution is to reinstall your sql with default settings or change the colletion to SQL_Latin1_General_CP1_CI_AI. you can do this by running
start /wait <dvd path>\setup.exe /qb INSTANCENAME=MSSQLSERVER REINSTALL=SQL_Engine REBUILDDATABASE=1 SAPWD=password SQLCOLLATION=SQL_Latin1_General_CP1_CI_AI
make sure you run tis command from 'setup bootstrap' folder. you do this by typing cdm at command prompt then using cd command to navigate to 'setup bootstrap' folder. If you have sql2000 you need to reinstall.