Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Update sql server database

Author  Topic 

Nebby
Starting Member

9 Posts

Posted - 2005-03-24 : 04:47:02
hi, I want to update a database A with value's of database B, database A is the SQL server DB, database B is an access database...

A(worknumber, work)
B(worknumber, work)

the same tables but in a other Database

how can I do this?

Stoad
Freaky Yak Linguist

1983 Posts

Posted - 2005-03-24 : 05:16:02
How many tables?
Do you want to add ("to insert" in SQL terms) data from B-tables to A-tables?
Go to Top of Page

Nebby
Starting Member

9 Posts

Posted - 2005-03-24 : 05:18:52
well, take 1 table of sql to update with 1 table out an access database
Go to Top of Page

Stoad
Freaky Yak Linguist

1983 Posts

Posted - 2005-03-24 : 05:37:46
update A set A.[work]=Z.[work] from A inner join
(
select * from opendatasource('microsoft.jet.oledb.4.0',
'data source=D:\...\Nebby.mdb')...B
)Z
on A.worknumber=Z.worknumber
Go to Top of Page

Nebby
Starting Member

9 Posts

Posted - 2005-03-24 : 06:06:42
what's the meaning of the 3 point between: Nebby.mdb')...B? and where do I put these code?


Go to Top of Page

Stoad
Freaky Yak Linguist

1983 Posts

Posted - 2005-03-24 : 06:16:39
It's just a SYNTAX req of the opendatasource statement.
Go to Top of Page

Stoad
Freaky Yak Linguist

1983 Posts

Posted - 2005-03-24 : 06:24:18
> and where do I put these code?

In Query Analyzer.
But don't execute it (the code) if you don't understand what will it do against table A.
Go to Top of Page

Nebby
Starting Member

9 Posts

Posted - 2005-03-24 : 06:34:48
Server: Msg 7415, Level 16, State 1, Line 1
Ad hoc access to OLE DB provider 'microsoft.jet.oledb.4.0' has been denied. You must access this provider through a linked server.

I get this error :s, Is a linked server the solution?
Go to Top of Page
   

- Advertisement -