In EF 6.1 you can run the command:
update-database -script
This generates the full SQL script for one or many migrations. The problem we f
If you are trying to alter a 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'))
Reference:
https://stackoverflow.com/a/20352867/150342