在现有数据库上使用 PivotRunner 更新现有架构时,我遇到了以下错误。
我不知道为什么 view 可能会返回一个空命令。最可信的案例是什么?如果检查此错误,我的程序也会出现相同的错误,我应该检查什么?
感谢您的回答,
{System.ArgumentNullException: Value cannot be null.
Parameter name: command
at CodeFluent.Runtime.Database.Management.SqlServer.PivotRunner.ExecuteNonQuery(String command, Boolean incrementChangesCount)
at CodeFluent.Runtime.Database.Management.SqlServer.PivotRunner.UpdateView(PivotRunnerView view, View existingView)
at CodeFluent.Runtime.Database.Management.SqlServer.PivotRunner.Run()
at CodeFluentAssociationMigration.MigrateAssociationsDB.migrate(String associationModelPath, String connectionString) in C:\MyPath\MyProgram.cs:line 190
at CodeFluentAssociationMigration.Program.Main(String[] args) in C:\MyPath\MyProgram.cs:line 17
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()}
我在日志文件中的唯一跟踪如下:
[04/04/2016 12:18:47] : Checking unique keys...
[04/04/2016 12:18:47] : Checking views...
编辑:这些是我的数据透视文件的视图元素
<views>
<view name="vAccount" schema="Association">
CREATE VIEW [Association].[vAccount]
AS
SELECT [Association].[Account].[Account_AccountId], [Association].[Account].[Account_Label], [Association].[Account].[Account_NumberInt], [Association].[Account].[Account_NumberExt], [Association].[Account].[Account_InitialValue], [Association].[Account].[Account_AccountType_AccountTypeId], [Association].[Account].[Account_AccountCategory_AccountCategoryId], [Association].[Account].[Account_IsUsedByDefault], [Association].[Account].[Account_IsDeactivated], [Association].[Account].[Account_IsReadyForClosure], [Association].[Account].[_rowVersion], [Association].[Account].[_trackCreationTime], [Association].[Account].[_trackLastWriteTime], [Association].[Account].[_trackCreationUser], [Association].[Account].[_trackLastWriteUser]
FROM [Association].[Account]
</view>
<view name="vAccountBalanceHistory" schema="Association">
CREATE VIEW [Association].[vAccountBalanceHistory]
AS
SELECT [Association].[AccountBalanceHistory].[AccountBalanceHistory_AccountBalanceHistoryId], [Association].[AccountBalanceHistory].[AccountBalanceHistory_AccountingPeriod_AccountingPeriodId], [Association].[AccountBalanceHistory].[AccountBalanceHistory_Account_AccountId], [Association].[AccountBalanceHistory].[AccountBalanceHistory_DebitBalance], [Association].[AccountBalanceHistory].[AccountBalanceHistory_CreditBalance], [Association].[AccountBalanceHistory].[_rowVersion], [Association].[AccountBalanceHistory].[_trackCreationTime], [Association].[AccountBalanceHistory].[_trackLastWriteTime], [Association].[AccountBalanceHistory].[_trackCreationUser], [Association].[AccountBalanceHistory].[_trackLastWriteUser]
FROM [Association].[AccountBalanceHistory]
</view>
<view name="vAccountCategory" schema="Association">
CREATE VIEW [Association].[vAccountCategory]
AS
SELECT [Association].[AccountCategory].[AccountCategory_AccountCategoryId], [Association].[AccountCategory].[AccountCategory_Number], [Association].[AccountCategory].[AccountCategory_Label], [Association].[AccountCategory].[_rowVersion], [Association].[AccountCategory].[_trackCreationTime], [Association].[AccountCategory].[_trackLastWriteTime], [Association].[AccountCategory].[_trackCreationUser], [Association].[AccountCategory].[_trackLastWriteUser]
FROM [Association].[AccountCategory]
</view>
<view name="vAccountingEntry" schema="Association">
CREATE VIEW [Association].[vAccountingEntry]
AS
SELECT [Association].[AccountingEntry].[AccountingEntry_AccountingEntryId], [Association].[AccountingEntry].[AccountingEntry_Date], [Association].[AccountingEntry].[AccountingEntry_Label], [Association].[AccountingEntry].[AccountingEntry_Debit], [Association].[AccountingEntry].[AccountingEntry_Credit], [Association].[AccountingEntry].[AccountingEntry_DocumentNumber], [Association].[AccountingEntry].[AccountingEntry_Account_AccountId], [Association].[AccountingEntry].[AccountingEntry_TVA_TVAId], [Association].[AccountingEntry].[AccountingEntry_PaymentMode], [Association].[AccountingEntry].[AccountingEntry_LabelAdditional], [Association].[AccountingEntry].[AccountingEntry_Status], [Association].[AccountingEntry].[AccountingEntry_EntryType], [Association].[AccountingEntry].[_rowVersion], [Association].[AccountingEntry].[_trackCreationTime], [Association].[AccountingEntry].[_trackLastWriteTime], [Association].[AccountingEntry].[_trackCreationUser], [Association].[AccountingEntry].[_trackLastWriteUser]
FROM [Association].[AccountingEntry]
</view>
<view name="vAccountingPeriod" schema="Association">
CREATE VIEW [Association].[vAccountingPeriod]
AS
SELECT [Association].[AccountingPeriod].[AccountingPeriod_AccountingPeriodId], [Association].[AccountingPeriod].[AccountingPeriod_DateStart], [Association].[AccountingPeriod].[AccountingPeriod_DateEnd], [Association].[AccountingPeriod].[AccountingPeriod_IsClosed], [Association].[AccountingPeriod].[AccountingPeriod_LedgerURL], [Association].[AccountingPeriod].[AccountingPeriod_BalanceURL], [Association].[AccountingPeriod].[AccountingPeriod_ProfitAndLossURL], [Association].[AccountingPeriod].[_rowVersion], [Association].[AccountingPeriod].[_trackCreationTime], [Association].[AccountingPeriod].[_trackLastWriteTime], [Association].[AccountingPeriod].[_trackCreationUser], [Association].[AccountingPeriod].[_trackLastWriteUser]
FROM [Association].[AccountingPeriod]
</view>
<view name="vAccountType" schema="Association">
CREATE VIEW [Association].[vAccountType]
AS
SELECT [Association].[AccountType].[AccountType_AccountTypeId], [Association].[AccountType].[AccountType_Label], [Association].[AccountType].[AccountType_Group], [Association].[AccountType].[_rowVersion], [Association].[AccountType].[_trackCreationTime], [Association].[AccountType].[_trackLastWriteTime], [Association].[AccountType].[_trackCreationUser], [Association].[AccountType].[_trackLastWriteUser]
FROM [Association].[AccountType]
</view>
<view name="vAssociation" schema="Global">
CREATE VIEW [Global].[vAssociation]
AS
SELECT [Global].[Association].[Association_AssociationId], [Global].[Association].[Association_PrefectureNumber], [Global].[Association].[Association_NumberExt], [Global].[Association].[Association_Label], [Global].[Association].[Association_IsActive], [Global].[Association].[Association_Schema], [Global].[Association].[_rowVersion], [Global].[Association].[_trackCreationTime], [Global].[Association].[_trackLastWriteTime], [Global].[Association].[_trackCreationUser], [Global].[Association].[_trackLastWriteUser]
FROM [Global].[Association]
</view>
<view name="vAssociationUser" schema="Global">
CREATE VIEW [Global].[vAssociationUser]
AS
SELECT [Global].[AssociationUser].[AssociationUser_UserId], [Global].[AssociationUser].[AssociationUser_Association_AssociationId], [Global].[AssociationUser].[_rowVersion], [Global].[AssociationUser].[_trackCreationTime], [Global].[AssociationUser].[_trackLastWriteTime], [Global].[AssociationUser].[_trackCreationUser], [Global].[AssociationUser].[_trackLastWriteUser]
FROM [Global].[AssociationUser]
</view>
<view name="vCardPeriod" schema="Global">
CREATE VIEW [Global].[vCardPeriod]
AS
SELECT [Global].[CardPeriod].[CardPeriod_CardPeriodId], [Global].[CardPeriod].[CardPeriod_FromDate], [Global].[CardPeriod].[CardPeriod_ToDate], [Global].[CardPeriod].[CardPeriod_Season], [Global].[CardPeriod].[CardPeriod_TransferDate], [Global].[CardPeriod].[_rowVersion], [Global].[CardPeriod].[_trackCreationTime], [Global].[CardPeriod].[_trackLastWriteTime], [Global].[CardPeriod].[_trackCreationUser], [Global].[CardPeriod].[_trackLastWriteUser]
FROM [Global].[CardPeriod]
</view>
<view name="vSupplier" schema="Global">
CREATE VIEW [Global].[vSupplier]
AS
SELECT [Global].[Supplier].[Supplier_SupplierId], [Global].[Supplier].[Supplier_Label], [Global].[Supplier].[Supplier_NumberExt], [Global].[Supplier].[_rowVersion], [Global].[Supplier].[_trackCreationTime], [Global].[Supplier].[_trackLastWriteTime], [Global].[Supplier].[_trackCreationUser], [Global].[Supplier].[_trackLastWriteUser]
FROM [Global].[Supplier]
</view>
<view name="vTVA" schema="Association">
CREATE VIEW [Association].[vTVA]
AS
SELECT [Association].[TVA].[TVA_TVAId], [Association].[TVA].[TVA_DateStart], [Association].[TVA].[TVA_DateEnd], [Association].[TVA].[TVA_Rate], [Association].[TVA].[_rowVersion], [Association].[TVA].[_trackCreationTime], [Association].[TVA].[_trackLastWriteTime], [Association].[TVA].[_trackCreationUser], [Association].[TVA].[_trackLastWriteUser]
FROM [Association].[TVA]
</view>
</views>