Thanks. This is what I have so far and it seems to work when run on the server where the DB is located:
OSQL -s <<SERVER_NAME>>\<<DB_NAME>> -U <<USERNAME>> -P <<PASSWORD>> -i <<PATH_TO_SQL_COMMAND_FILE>>
The above makes the connection to the DB and runs the SQL statements held in a text file (PATH_TO_SQL_COMMAND_FILE), which looks a little like this:
UPDATE <<TABLE_NAME>>
SET <<Column>> = '<<VALUE>>'
WHERE <<PREDICTAES>>
GO
Now, I am facing the following issue. I am unable to run this command from a different server that does not host the DB. I get the below error: [Shared Memory]SQL Server does not exist or access denied. [Shared Memory]ConnectionOpen (Connect()).
I am using the host name of the DB server including DNS for server_name. Any ideas?
modified on Wednesday, December 10, 2008 9:15 AM