0

I'm new to Entity Framework so please excuse if the answer to this question is obvious. We have few databases with thousands of tables in them. Most of these are data tables, that means each data update process might add or remove tables from the database. I've created edmx file with only the tables I need. All the data tables will be used in dynamic SQL based on the functionality.

Now my question is, Can we use dynamic SQL using Entity Framework. I tried using Entity Client with dynamic SQL, but that doesn't allow me to run the query as those tables are not part of the model. Is there any other way to do it?

EDIT: Adding or Removing tables on each data update process is possible but highly unlikely. We have a reference table that holds references to all the data tables we need. The primary question here really is "Can we use Entity Framework to execute queries against tables that are not part of the model (The tables sometimes might be from another database)?"

Thanks.

3
  • 1
    Each data update might add or remove tables from the database? Commented Aug 18, 2010 at 20:00
  • If you're going to build a schema-free DB, don't use SQL Server to do it. Commented Aug 18, 2010 at 20:33
  • Are you saying that the tables all have schemas known at compile time? Because if not, you'd have no way to store the data. Commented Aug 19, 2010 at 1:49

1 Answer 1

2

This is really not what EF is made for. You might try using a SqlCommand against the DB directly, but I agree with Craig Stuntz on this one.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.