Just had a small issue with my SQL Database project.
In my Script.PostDeployment.sql file I put a standard SQL comment at the end of a line just to remind me of the required data load order;
:r LoadLookupTable.sql :r LoadTestData.sql -- Must load LookupTable firstWhen building the project this caused the following error;
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v9.0\TeamData\Microsoft.Data.Schema.SqlTasks.targets(80,5)Error MSB4018: The "SqlSetupDeployTask" task failed unexpectedly.System.ArgumentException: Illegal characters in path. at System.IO.Path.CheckInvalidPathChars(String path) at System.IO.Path.IsPathRooted(String path) at Microsoft.Data.Schema.Sql.Build.SqlDeploymentScriptModifier.GenerateMergedSqlCmdFiles(ContributorConfigurationSetup setup, ContributorConfigurationFile configFile) at Microsoft.Data.Schema.Sql.Build.SqlDeploymentScriptModifier.OnEstablishDeploymentConfiguration(ContributorConfigurationSetup setup) at Microsoft.Data.Schema.Build.DeploymentProjectBuilder.VerifyConfiguration() at Microsoft.Data.Schema.Tasks.DBSetupDeployTask.BuildDeploymentProject(ErrorManager errors, ExtensionManager em) at Microsoft.Data.Schema.Tasks.DBSetupDeployTask.Execute() at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult) Done executing task "SqlSetupDeployTask" -- FAILED.By moving the comment to its own line like the following it then built correctly;
:r LoadLookupTable.sql -- Must load LookupTable first :r LoadTestData.sqlI know it's because it's being interpreted in SQLCMD mode but you'd think the parser would be smart enough to ignore it.

Thanks! That fixed it for me.
ReplyDelete