Cannot deploy database from TFS
Having a really tricky issue deploying a composite database solution from TFS to my local sql install.
I wonder if anyone can offer advice? Thanks
Composite database projects in Team Foundation Server. MarketRisk and MarketRisk_Structure. Both have references to another database called DataMirror.
MarketRisk_Structure contains a view vwLiveTrades which as scripted is:
SELECT * FROM [$(LSRV_ENQ)].[$(DataMirror)].dbo.AS400_Positions
In MarketRisk_Structure project, there is a reference to DataMirror in the References, and also a variable in SQLCMDVARS for both DataMirror and LSRV_ENQ (a linked server).
On MarketRisk project, there is a reference to Datamirror in the References, and also a variable in SQLCMDVARS for both DataMirror and LSRV_ENQ (a linked server).
I think I need both the DataMirror ref and the LSRV_ENQ ref in both projects because sprocs in MarketRisk call out to the linked server, and views in MarketRisk_Structure call out to the linked server.
I don't know if it's this circular reference that would cause the below issue:
MarketRisk.dbschema(0,0)Error TSD00563: This deployment may encounter errors during execution because [dbo].[spRetrieveSingleIntraDayTradeFromLive] depends on [dbo].[vwLiveTrades].[OptionPremiumDueDate] and [dbo].[vwLiveTrades].[OptionPremiumDueDate] does not exist in the target database.
I get many many of these errors, all because of the spRetrieveSingleIntraDayTradeFromLive in MarketRisk trying to reference columns in the MarketRisk_Str开发者_如何学编程ucture view.
MarketRisk.dbschema(0,0)Error TSD01234: Plan verification encountered errors; deployment cannot continue.
I had the same problem, but since it was a legacy database with thousands of "warnings", I couldn't realistically get rid of all the warnings. The TSD01234 error is caused by having the "Verify Deployment" setting checked in your project's .sqlDeployment file (it is the last one under "advanced options"). After I disabled the Verify Deployment option, I was able to generate a deployment script.
For anyone hitting this problem:
I resolved by explicitly naming all the columns in the view. Deployment didn't like the wildcard.
Also, needed to set the Target Database Name in the Deploy properties for the MarketRisk_Structure to be "MarketRisk".
Regards Graeme
精彩评论