Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8876799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:18:05+00:00 2026-06-14T19:18:05+00:00

I need someone’s expertise on the following: I am building a web-facing system for

  • 0

I need someone’s expertise on the following:

I am building a web-facing system for a client which needs to sync 30-odd tables between it and their .NET 1.1 WinForms application. To minimise interaction between us for the sake of both of our sanity, I suggested using XML, like so

SELECT *
FROM table1
FOR XML AUTO, XMLDATA

The caveat is that I need the primary keys to remain the same between the source and destination DB’s. Is there an elegant way of importing the XML? I don’t want to write ugly SQL to drop and recreate tables and relationships each time there is a data sync. Is there a way via ADO.NET or Entity Framework 3 to tell the database “Look, here’s your data, please use it instead of what you currently have”?

Here’s an example of the exported XML:

<taxGroup>
   <Schema name="Schema29" xmlns="urn:schemas-microsoft-com:xml-data" xmlns:dt="urn:schemas-microsoft-com:datatypes">
      <ElementType name="taxGroup" content="empty" model="closed">
         <AttributeType name="taxGroupId" dt:type="i8"/>
         <AttributeType name="regionId" dt:type="i8"/>
         <AttributeType name="description" dt:type="string"/>
         <AttributeType name="percentage" dt:type="number"/>
         <AttributeType name="exportNumber" dt:type="string"/>
         <attribute type="taxGroupId"/>
         <attribute type="regionId"/>
         <attribute type="description"/>
         <attribute type="percentage"/>
         <attribute type="exportNumber"/>
      </ElementType>
   </Schema>
   <taxGroup xmlns="x-schema:#Schema29" taxGroupId="38000001" regionId="1482000001" description="VAT" percentage="0.1400" exportNumber=""/>
   <taxGroup xmlns="x-schema:#Schema29" taxGroupId="38000002" regionId="1482000001" description="VAT2" percentage="0.1700" exportNumber=""/>
</taxGroup> 

Note: the two DB’s don’t have access to one another. The transport is via Secure HTTPRequest.

Update 2: The Winforms app uses SQL2000, which makes using the Synch Framework impossible, apparently…

Update 3: Let’s just take it as a given that I am stuck having to do things in this manner. The .NET app is deployed at various 3rd party sites, each having a separate copy of the DB and connecting to a separate instance of the web application. It’s a reseller package, for all intents and purposes: a physical storefront component and an online store component. Some third parties refuse to upgrade from SQL2000.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T19:18:06+00:00Added an answer on June 14, 2026 at 7:18 pm

    Okay, so I took this problem to our MD, who was a system’s architect in a previous life. He suggested I import the XML into a separate holding database with an identical structure. Before I add the data, I disable constraint checking and empty all the tables in staging:

    EXEC sp_msforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all";
    EXEC sp_msforeachtable "DELETE FROM ? ";
    EXEC sp_msforeachtable "ALTER TABLE ? WITH CHECK CHECK CONSTRAINT all";
    

    I then import the XML into the staging DB by reading it into an ADO.NET DataSet and writing each row into the corresponding table in the DB. I can take lots of liberties because the source table has the exact same schema and plus the exported XML has the schema right there in the header, so everything is straightforward.

    I then execute a custom stored procedure on the target DB that first fires off

    EXEC sp_msforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all";
    

    then DELETEs everything from my target tables. I can’t simply run [EXEC sp_msforeachtable “ALTER TABLE ? NOCHECK CONSTRAINT all”] because there are extra tables in the target DB which would also be affected.

    I then simply do a

    SELECT INTO 
    

    from each table in staging to its duplicate in the target.
    Finally, I run

    EXEC sp_msforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all";
    

    To make sure every constraint is back the way it was.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please need someone's expertise on my link; http://360webmedia.com/Store/development/index.html In my my menu_left.jpg is displaying
I need someone to explain the following names; Asynchronous Delegates. Asynchronous methods. Asynchronous events.
I just need someone to correct my understanding of this regex , which is
I'm looking into making a web crawler/spider but I need someone to point me
Again, I need someone's help. I am following the below tutorial for SQLite connection
I am a very beginner and I need someone to tell me, which way
Need someone to help me to crack the following. On my local machine, i'm
I need someone help. When I open https://developers.facebook.com/docs/reference/api/ and clicked https://graph.facebook.com/me/likes?access_token=blablabla , I got
I need someone to lead/guide me where have I code wrongly because I can't
I need someone to back me up, or prove me wrong, in regard to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.