2014-02-14 119 views
0

我跑FluentMigrator創建表的權限被拒絕

C:\開發\遷移> MSBuild.exe \ build.proj/T:從PowerShell的遷移

fluentmigrate項目

而且收到以下錯誤:

!!! 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'. 

這裏是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> 

不應該從連接字符串的用戶詳細信息中獲取權限嗎?作爲數據庫所有者連接

+0

這是一個管理員帳戶?你是在正常模式還是高架模式下運行? – jessehouwing

+0

我以管理員身份運行powershell – Axe

+0

您的ConnectionString是否指定了一個用戶,例如格式爲Server = yourserver,1433; Database = somedb; User ID = User1; Password = Password1 ...' – Raf

回答

0

不應該從連接字符串用戶 的詳細信息中獲取權限嗎?作爲數據庫所有者連接

爲了找到答案,請查看您的應用程序事件日誌以瞭解發生此情況的時間。事件條目還應包含被拒絕權限的用戶名。