Queries on tables from different data sources

Discussion in 'ASP .Net Web Services' started by John, Jun 28, 2004.

  1. John

    John Guest

    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
     
    John, Jun 28, 2004
    #1
    1. Advertising

  2. 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" <> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
    news:#1MJE#...
    > 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
    >
    >
     
    Kondratyev Denis, Jun 29, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. AD
    Replies:
    1
    Views:
    1,056
    Francis Shanahan
    Aug 23, 2003
  2. John
    Replies:
    1
    Views:
    300
    =?Utf-8?B?VG9Kbw==?=
    Jul 1, 2004
  3. Petr Vlcek
    Replies:
    1
    Views:
    420
    Martin Honnen
    Oct 12, 2005
  4. Ian Roddis

    xslt queries in xml to SQL queries

    Ian Roddis, Feb 26, 2006, in forum: Python
    Replies:
    3
    Views:
    1,532
    Crutcher
    Feb 26, 2006
  5. Abby Lee

    so many queries within queries I'm confused

    Abby Lee, Aug 4, 2004, in forum: ASP General
    Replies:
    11
    Views:
    367
    Aaron [SQL Server MVP]
    Aug 6, 2004
Loading...

Share This Page