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

  • Home
  • SEARCH
  • 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 966231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:07:29+00:00 2026-05-16T02:07:29+00:00

I have a very dynamic SQL Server problem to solve. I am developing a

  • 0

I have a very dynamic SQL Server problem to solve. I am developing a tool that verifies matched data in multiple databases. [NOTE: the requirements on this project are pretty strict]

I need to make a C# tool that lets a user select any database from a dynamic list, then lets the user select a table (acting as a source db/table). Once that is done, the user does it again for another database and table (or multiple tables as the destination)

Once a source and destination are chosen, the user may select which fields map-on-to which other fields.

Finally, the program needs to loop over the records in the source table and find any matching keys in the destination table. It needs to check things like, only one key matches, all the other mapped fields have the same data, etc…

I would like to use Linq in my code and just pass strings for the fields/tables that I am running this basic logic against. The problem is that the databases & schema are unknown at compile time.

I am looking for direction on this matter. I can’t seem to find a solution. The closest I have come is the dynamic Linq-to-sql library that is out there. But that is only dynamic within the bounds of you data model. I can’t even have a data model.

I was thinking of dropping the whole Linq thing all together an just writing my own quick and dirty method chaining to generate the basic SQL that I need (basically a fancy string builder).

  • 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-05-16T02:07:30+00:00Added an answer on May 16, 2026 at 2:07 am

    I don’t think Linq-to-SQL is very well suited for this task. L2S excels at getting your business objects from database, and updating them again – one (or a few) at a time.

    I don’t think using Linq-to-SQL will greatly benefit you in this case, where you’re really dealing with the metadata about the databases and tables in question. In this case, you can either use straight SQL and ADO.NET (SqlDataReader preferably) to query the system catalog views (like sys.tables, sys.columns and so forth), or you could think about using the SQL Server Management Objects (SMO) library to get access to the innards of your SQL Servers.

    Either way, you’ll probably end up with lists of objects you’ve assembled yourself from the bits and pieces – and you can, of course, use Linq-to-Objects on those in-memory lists and collections, no problem.

    Some resources to check out:

    • MSDN OVerview of SMO
    • As if to prove me wrong: Linq-to-SQL Data Synchronizer (using SMO under the covers)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 487k
  • Answers 487k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You cannot increment or change a string literal - they… May 16, 2026 at 8:27 am
  • Editorial Team
    Editorial Team added an answer I don't think there's enough detail in this question to… May 16, 2026 at 8:27 am
  • Editorial Team
    Editorial Team added an answer Use this instead: ^([0-9])*$ or, more simply: ^\d*$ \d means… May 16, 2026 at 8:27 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

No related questions found

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.