0

I'm running

C:\Dev\Migrate> MSBuild.exe .\build.proj /t:Migrate

from powershell on a fluentmigrate project

And getting the following error :

!!! An error occured executing the following sql:
CREATE TABLE [dbo].[VersionInfo] ([Version] BIGINT NOT NULL)
The error was CREATE TABLE permission denied in database 'H2H'.

Here is the build.proj

<?xml version="1.0"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
         DefaultTargets="Migrate" ToolsVersion="4.0">

  <PropertyGroup>
    <MigratorTasksDirectory>$(MSBuildProjectDirectory)\..\EqulibriumMarkets\packages\FluentMigrator.Tools.1.1.2.1\tools\AnyCPU\40\</MigratorTasksDirectory>
    <MainProjectDirectory>$(MSBuildProjectDirectory)</MainProjectDirectory>
      <ConnectionString>******************************</ConnectionString>
  </PropertyGroup>

  <UsingTask
      TaskName="FluentMigrator.MSBuild.Migrate"  AssemblyFile="$(MigratorTasksDirectory)FluentMigrator.MSBuild.dll" />

  <Target Name="Migrate">
    <Message Text="Starting FluentMigrator migration" />

    <!-- Important: Target must be your Migrations assembly name, not your dll file name -->
    <Migrate Database="SqlServer2012"
             Connection="$(ConnectionString)"
             Target="$(MSBuildProjectDirectory)/bin/debug/EQ.DbMigration.dll" />
  </Target>
</Project>

Shouldn't permissions be taken form the connection string user details? connecting as db owner?

Axe
  • 764
  • 6
  • 29

1 Answers1

0

Shouldn't permissions be taken form the connection string user details? connecting as db owner?

To find out, check your application event log for an entry around the time this occurs. The event entry should also contain the user name that is being denied permission.

Nicodemeus
  • 4,005
  • 20
  • 23