Access linked Server / tables results in wrong queries / SDAC 7.3.16
Posted: Fri 21 Apr 2017 10:39
Hi,
when updating a view pointing to a table on a linkerd server, an error occurs:
1) I set up a linked server [MyLinkedServer] in SQL-Server
2) I created a view in SQL-Server pointing to a table [MyTable] of the linked server:
create view MyView as
select ID, MyField from [MyLinkedServer]...[MyTable]
3) in Delphi XE10 I used MSConnection, MSQuery and MSDatasource to access [MyView]. with "select ID, MyField from MyView". Executing (select) works fine.
5) But when I try to make an update, MSQuery resonds with an error: "Table MyTable" not found.
6) Also MSQuery SQL-Generator seems to analyze MyQuery and says "Table MyTable not found"
Why is MSQuery analyzing the view and why is the component replacing [MyLinkedServer]...[MyTable] with [MyTable] which is wrong?
Updating MyView in SQL-Managent-console works fine!
Due to design I cannot manually edit the corresponding SQl-Strings of MSQuery (SQLUpdate, SQLSelete ...)
Thanks for help,
Dietrich
when updating a view pointing to a table on a linkerd server, an error occurs:
1) I set up a linked server [MyLinkedServer] in SQL-Server
2) I created a view in SQL-Server pointing to a table [MyTable] of the linked server:
create view MyView as
select ID, MyField from [MyLinkedServer]...[MyTable]
3) in Delphi XE10 I used MSConnection, MSQuery and MSDatasource to access [MyView]. with "select ID, MyField from MyView". Executing (select) works fine.
5) But when I try to make an update, MSQuery resonds with an error: "Table MyTable" not found.
6) Also MSQuery SQL-Generator seems to analyze MyQuery and says "Table MyTable not found"
Why is MSQuery analyzing the view and why is the component replacing [MyLinkedServer]...[MyTable] with [MyTable] which is wrong?
Updating MyView in SQL-Managent-console works fine!
Due to design I cannot manually edit the corresponding SQl-Strings of MSQuery (SQLUpdate, SQLSelete ...)
Thanks for help,
Dietrich