Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Queries on tables from different data sources

Reply
Thread Tools

Queries on tables from different data sources

 
 
John
Guest
Posts: n/a
 
      06-28-2004
Hi

I need to perform two queries in sequence on two identical access tables.
The source table is coming from a dataset returned by a web method and the
destination table is from a local access table. The queries are;

UPDATE [destTbl] INNER JOIN srcTbl ON [destTbl].entry_id = srcTbl.entry_id
SET [destTbl].field1 = [srcTbl].[field1], [destTbl].field2 =
[srcTbl].[field2];

and

INSERT INTO [destTbl] (field1, field2)
SELECT srcTbl.field1, srcTbl.field2
FROM srcTbl
WHERE (((srcTbl.entry_id) Not In (SELECT srcTbl.entry_id FROM [destTbl])));

I have two problems. a) What code do I need to tell the query that srcTble
is from the web method. b) There seem to be two connections; a web
connection and a local connection. What connection should I use to execute
the query?

If I have totally misunderstood how to carry this out then please let me
know.

Thanks

Regards


 
Reply With Quote
 
 
 
 
Kondratyev Denis
Guest
Posts: n/a
 
      06-28-2004

Are your tables big (1000000 records) or not so big? If table has not many
records u can load data from destination table to DataTable or DataSet and
merge (manualy or with Merge() method) your tables and after that update
your destination local table.


"John" <(E-Mail Removed)> сообщил/сообщила в новостях следующее:
news:#1MJE#(E-Mail Removed)...
> Hi
>
> I need to perform two queries in sequence on two identical access tables.
> The source table is coming from a dataset returned by a web method and the
> destination table is from a local access table. The queries are;
>
> UPDATE [destTbl] INNER JOIN srcTbl ON [destTbl].entry_id = srcTbl.entry_id
> SET [destTbl].field1 = [srcTbl].[field1], [destTbl].field2 =
> [srcTbl].[field2];
>
> and
>
> INSERT INTO [destTbl] (field1, field2)
> SELECT srcTbl.field1, srcTbl.field2
> FROM srcTbl
> WHERE (((srcTbl.entry_id) Not In (SELECT srcTbl.entry_id FROM

[destTbl])));
>
> I have two problems. a) What code do I need to tell the query that srcTble
> is from the web method. b) There seem to be two connections; a web
> connection and a local connection. What connection should I use to execute
> the query?
>
> If I have totally misunderstood how to carry this out then please let me
> know.
>
> Thanks
>
> Regards
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
xslt queries in xml to SQL queries Ian Roddis Python 3 02-26-2006 06:49 PM
bind multiple data tables from sql queries to multiple datacontainers? Daves ASP .Net 1 01-06-2006 04:17 PM
Sources on optimizing XPath queries Petr Vlcek XML 1 10-12-2005 11:34 AM
Queries on tables from different data sources John ASP .Net 1 07-01-2004 09:25 PM
Bind different rows to different data sources in data grid AD ASP .Net 1 08-23-2003 10:34 PM



Advertisments