Batch Update ADO.Net

D

Derek Hart

Using SQL Server 2000, and VS.Net 2003

I want to load a datatable from a local server into a dataset and update it
into a linked server. The linked server will have the exact same structured
table, and it will be empty. Can I open a blank dataset from the linked
server, and fill it with the dataset from the local server? I have been
trying every which way to get this working. Is it possible? It is too slow
doing a transact sql statement that does the insert from the local to the
linked, so I am trying this method. Any thoughts?

Derek
 
T

Tasos Vogiatzoglou

.... A more "SQL" approach

EXEC sp_addlinkedserver 'your server'
EXEC sp_addlinkedsrvlogin 'your server', 'false', 'luser', 'rmtuser',
'rmtPassword'


SELECT * INTO YOUR_TABLE FROM YOUR_SERVER.DATABASE.dbo.TABLE

or

INSERT INTO YOUR_TABLE (COLUMNS) SELECT COLUMNS FROM
YOUR_SERVER.DATABASE.dbo.TABLE


Regards,
Tasos
 
T

Tasos Vogiatzoglou

Forgot to mention that you should

EXEC sp_dropserver 'your server', 'droplogins'

after finishing.

Tasos
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top