0

I am using entityFrameworks6 / POCO / code first.

Is there a simple way to delete a table if it already exists?

I have seen many similar questions but I cant get any to work. Probably cos they are for older versions.

The kind of think I'm looking for is...

class Program {
    static void Main(string[] args)  {
        var db = new DatabaseContext2();

        //delete table - this doesnt work
        db.Database.ExecuteSqlCommand("drop if exists table myTableName"); 
spiderplant0
  • 3,872
  • 12
  • 52
  • 91

0 Answers0