I am trying to figure out why i can execute a sql script inside management studio, but cannot execute the same script from a dos command prompt, using sqlcmd to execute the script. I have SQL Server 2008 standard on my local machine, using mixed authentication (I've also tried with Windows Auth). The remote server has SQL Server 2000 with mixed authentication. They are both in the same domain. I can log into either server with my credentials from the dos command prompt.
The really strange thing is that if i go into management studio and test the linked server connection, the script will work from the command prompt for a little while (maybe 15 minutes, i haven't timed it). If i don't first test the connection, it fails with "Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection."
Any ideas?
Thanks for any advice
The really strange thing is that if i go into management studio and test the linked server connection, the script will work from the command prompt for a little while (maybe 15 minutes, i haven't timed it). If i don't first test the connection, it fails with "Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection."
Any ideas?
Thanks for any advice