Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


PROBLEMS WHEN UPDATING LINKED SERVER WITH MSSQL DATABASE


PROBLEMS WHEN UPDATING LINKED SERVER WITH MSSQL DATABASE

Author
Message
koen_huys
koen_huys
Grasshopper
Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)

Group: General Forum Members
Points: 11 Visits: 78
I have a linked server (mysql) and I want to update some colums with the information on MSSQL information

now I get the following error

OLE DB provider "MSDASQL" for linked server "mysqlapp" returned message "Data provider or other service returned an E_FAIL status.".
Msg 7330, Level 16, State 2, Line 1
Cannot fetch a row from OLE DB provider "MSDASQL" for linked server "mysqlapp".

where mysqlapp is the name of my linked server



update tabel3

set tabel3.price = dt.ac_prixVen
from openquery (mysqlapp, 'select * from product_special') as tabel3
inner join (select Ar_ref, Ac_prixVen, AC_categorie,product_id, price
from openquery (mysqlapp, 'select * from product') as tabel2 inner join
tractov15.dbo.f_artclient as tabel1
on tabel2.model = tabel1.ar_ref where tabel1.ac_categorie = '1'
) as dt on
tabel3.product_id = dt.product_id
where tabel3.customer_group_id = '1'
and tabel3.price<> dt.ac_prixVen
Jack Corbett
  Jack Corbett
SSChampion
SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)

Group: General Forum Members
Points: 11054 Visits: 14858
Can you successfully run a SELECT query against the linked server?

What does sp_testlinkedserver do?



Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming
At best you can say that one job may be more secure than another, but total job security is an illusion. -- Rod at work

Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
koen_huys
koen_huys
Grasshopper
Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)

Group: General Forum Members
Points: 11 Visits: 78
Yes I can
And when I run the below query this works also,

update dt
set dt.quantity =a.as_qtesto-a.as_qteres
from openquery(mysqlapp,'select * from product')as dt
inner join TRACTOV15.dbo.f_artstock as a on
dt.model = a.ar_ref collate database_default
where a.de_no ='15'
and dt.quantity<>a.as_qtesto-a.as_qteres

the only difference between the 2 queries is

- first on is only between 2 tables (one in mssql and the second in mysql)
- second one is with 3 tables (one in mssql and 2 tables in mysql)

and the second difference is

- first query is an update of the stock so no digits behind the dot example : 5
- second query is an update of the price example: 15.25

the only thing that i didn't test at this moment is the mssql database works like 15,25 and i think the mysql database works with 15.25
I was still looking how to convert a 15,25 price to a 15.25 price
but I am not sure if this gives the problem
koen_huys
koen_huys
Grasshopper
Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)

Group: General Forum Members
Points: 11 Visits: 78
I downloaded the database of mysql from the another server and then I made a linked server off,
what I see now is that it works so my problem is that I get the error when connecting a linked server to another server with mysql

has anybody some suggestions how to solve this issue

I need this to work, it is not an option to download each time the mysql database adjust it and place it back to the other server
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search