• Hi,

    Thanks for the response and apologies about the vagueness. I'll try to be a bit more specific.

    The SQLCmd is getting the sql from a networked file using:

    sqlcmd -S [Server2] -d [DBName] -b -i "\\NetworkScriptLoc\testview.sql"

    The testview.sql just contains

    If not exist...

    Create view as

    Select c2, etc from Server1.DbName.dbo.TableName

    and the error is the old favourite - "Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. Reason: Token-based server access validation failed with an infrastructure error. Check for previous errors". However, other scripts creating other objects work even when this fails and they are all using the same technique and service account. The only difference is that the view has a reference back to the server initiating the request.

    SQL DBA
    Every day is a school day, and don't trust anyone who tells you any different.
    http://sqlblogness.blogspot.co.uk