在使用大量数据的表中添加和更新新列时出现问题

时间:2014-05-02 12:09:15

标签: entity-framework azure ef-code-first

我正在使用Entity Framework 5到Microsoft azure服务器。 我有一张包含数百万条记录的表格。我需要添加两列并将其更新为给定值。我编写的代码如下:

public override void Up()
{
    AddColumn("dbo.MST_FarmerProfile", "Season", c => c.String(maxLength: 500));
    AddColumn("dbo.MST_FarmerProfile", "Year", c => c.Int());

    Sql("Update MST_FarmerProfile Set Season='Kharif' where Season is NULL");
    Sql("Update MST_FarmerProfile Set Year=2013 where Year is NULL");
}

public override void Down()
{
    DropColumn("dbo.MST_FarmerProfile", "Year");
    DropColumn("dbo.MST_FarmerProfile", "Season");

}

在Azure服务器中部署之后,我不断地“等待操作超时”'例外,没有任何工作。

0 个答案:

没有答案