Click to See Complete Forum and Search --> : Connect MSSQL remotely by Query Analyzer


ankitmathur
10-17-2007, 08:16 AM
Hi,

I wish to know the syntax for connecting to a remote MSSQL 2000 DB Server via Query Analyzer.

Actually my requirement is to use the connection string to connect to the remote server, execute a SQL Statement on the remote server & save the resultset in a table on my local machine.

Can anybody helpme ?

ankitmathur
10-17-2007, 09:02 AM
Hi,

I have been able to do the task using the following code.


insert into some_table
SELECT *
FROM OPENDATASOURCE(
'SQLOLEDB',
'Data Source=ServerName;User ID=MyUID;Password=MyPass'
).Northwind.dbo.Categories