Originally posted by pml
Thanx a lot man. You really understood what I wanted but it looks like this will only work if both tables are on the same database. Let me exactly tell you what I want to do:
I have a function that takes a recordset as a parameter.
E.g UpdateServer(rsData as Recordset)
My system is a client server model system and this function is the server method.It is called by the client to update the table on the server with the data from the table on the client side. This tables have exactly the same structure but pls note that they reside on different databases.
Thanx a lot in advance.
Code:
SELECT * FROM [TableDestination] SELECT * FROM [TableSource]
oops this one is wrong must be
Code:
INSERT INTO [TableDestination] SELECT * FROM [TableSource]

If your tables are on different databases use
Code:
INSERT INTO [DB1].dbo.[TableDestination] SELECT * FROM [DB1].dbo.[TableSource]
Its also possible to use tables on different server, but then u must first link the sql server. I think thats the most advanced link there is.
Code:
[SQLServer].[Databasename].[Databaseowner (on sql most cases dbo)].[Tablename].[Fieldname]
for example
Code:
SELECT [Server1].[DB1].[dbo].[Table1].[Field1], [Server1].[DB2].[dbo].[Table1].[Field1], [Server2].[DB1].[dbo].[Table1].[Field1]
FROM [Server1].[DB1].[dob].[Table1], [Server1].[DB2].[dob].[Table1], [Server2].[DB1].[dob].[Table1]
WHERE [Server1].[DB1].[dob].[Table1] = [Server1].[DB2].[dob].[Table1] AND [Server1].[DB2].[dob].[Table1].[FieldID] = [Server2].[DB2].[dob].[Table1].[FieldID]
This is a pretty advanced query, that links 2 databases on the same server with a database on a 2the server.
Greets Nightmare