locked
Create table on runtime RRS feed

  • Question

  • User-235226130 posted

    Hi 

    Is it possible create table and  it schema at runtime ?  use Entityframework Core

    for example, click a button, the backend code detect today's date and create a table named 20191209 and it schema

    Monday, December 9, 2019 9:11 AM

Answers

All replies

  • User-821857111 posted

    You can't use LINQ to generate CREATE TABLE (or other DML) commands. But you can execute raw SQL commands using EF Core: https://www.learnentityframeworkcore.com/raw-sql

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, December 9, 2019 9:33 AM
  • User-235226130 posted

    thanks !!

    Tuesday, December 10, 2019 7:35 AM
  • User753101303 posted

    Hi,

    create a table named 20191209

    Most often it means your table name includes a data. Double check creating a table is best compared maybe with having an additional column (and maybe two tables ie live data and archived data).

    Tuesday, December 10, 2019 9:08 AM