Change db table name in EF4 (entity framework 4)

If you just need to change the name of the table you can:

  1. Open EDMX file with XML Editor.
  2. Locate SSDL section in it.
  3. Locate entity set element for example <EntitySet Name="Customers" EntityType="ExampleModel.Store.Customers" Schema="dbo" />.
  4. Add Table="MyTableName" attribute. <EntitySet Name="Customers" EntityType="ExampleModel.Store.Customers" Schema="dbo" Table="MyTableName" />

Here is a complete CSDL, SSDL, MSL specification.

Hope that helps.

Leave a Comment