Adding 'GO' statements to Entity Framework migrations

前端 未结 5 1267
青春惊慌失措
青春惊慌失措 2020-12-01 16:36

So I have an application with a ton of migrations made by Entity framework. We want to get a script for all the migrations at once and using the -Script tag doe

5条回答
  •  南笙
    南笙 (楼主)
    2020-12-01 16:51

    If you are trying to alter your view using Sql("Alter View dbo.Foos As etc"), then you can avoid the should be the first statement in a batch file error without adding GO statements by putting the sql inside an EXEC command:

    Sql("EXEC('Alter View dbo.Foos As etc')")

提交回复
热议问题