I'm assuming this "@server=N'SQLSERVER'" has been changed to protect the guilty?
Just for grins either run the SSMS with Run As (Right-click icon --> Run As ... yada...)
or the other is to
from a command line:
X:\Program Files\Microsoft SQL Server\90\Tools\Binn
Sqlcmd -S ServerName -E -d DBName -q
and then run some simple query. You need to use GO as the separator.