E
Eric
I have a situation where I must restructure my data access, and was hoping
the community could give me pointers or links to articles that would help.
My situation is that I need to query data from two separate databases. One
is my application's own database, and the other is a Data Mart created for
me with a view I access. The way I do it currently requires that the
SQL-Servers be linked, and, given our security setup, on the same
SQL-Server.
Currently the cross database queries take two forms:
SELECT field FROM MyAppDataMart..vwAppData vw
JOIN MyOwnDatabaseTable tbl ON vw.Field = tbl.Field
OR
SELECT field FROM MyAppDataMart..vwAppData vw
WHERE NOT EXISTS(SELECT field FROM MyOwnDatabaseTable tbl WHERE vw.Field =
tbl.Field)
My current .NET business object merely makes a single stored procedure call
to retrieve a resultset, with any joins required handled by the stored
procedure. It is now considered unacceptable to have a dependency like that
in the stored procedure and I need to re-structure the data access such that
the .NET business object retrieves data separately from each database
eliminiating the need for one database to be able to be linked or even aware
of the other.
This means, however, that I must handle any JOIN or EXISTS logic in my
business object, and I am looking for strategies to accomplish that. From
what I have read so far, I'm not sure the DataRelation in ADO.NET can
enforce logic more complex than a INNER JOIN.
In short, what I need to go to is from
Existing:
-Call stored procedure which bridges Database1 and Database2 and returns a
resultset.
Desired:
-Retrieve info from Database1
-Retrieve info from Database2
-Apply any logic such as JOIN or EXISTS or NOT EXISTS to filter data
-Return resultset.
Any pointers or links would be greatly appreciated, thanks.
the community could give me pointers or links to articles that would help.
My situation is that I need to query data from two separate databases. One
is my application's own database, and the other is a Data Mart created for
me with a view I access. The way I do it currently requires that the
SQL-Servers be linked, and, given our security setup, on the same
SQL-Server.
Currently the cross database queries take two forms:
SELECT field FROM MyAppDataMart..vwAppData vw
JOIN MyOwnDatabaseTable tbl ON vw.Field = tbl.Field
OR
SELECT field FROM MyAppDataMart..vwAppData vw
WHERE NOT EXISTS(SELECT field FROM MyOwnDatabaseTable tbl WHERE vw.Field =
tbl.Field)
My current .NET business object merely makes a single stored procedure call
to retrieve a resultset, with any joins required handled by the stored
procedure. It is now considered unacceptable to have a dependency like that
in the stored procedure and I need to re-structure the data access such that
the .NET business object retrieves data separately from each database
eliminiating the need for one database to be able to be linked or even aware
of the other.
This means, however, that I must handle any JOIN or EXISTS logic in my
business object, and I am looking for strategies to accomplish that. From
what I have read so far, I'm not sure the DataRelation in ADO.NET can
enforce logic more complex than a INNER JOIN.
In short, what I need to go to is from
Existing:
-Call stored procedure which bridges Database1 and Database2 and returns a
resultset.
Desired:
-Retrieve info from Database1
-Retrieve info from Database2
-Apply any logic such as JOIN or EXISTS or NOT EXISTS to filter data
-Return resultset.
Any pointers or links would be greatly appreciated, thanks.