Error on Dynamic Database Upgrade
shanejokeeffe
Posts: 19 New member
Hi,
I'm getting the following error when performing a deployment of a database package for the first time:
If I re-run the deployment, I get a different object name each time. The database I'm deploying to is marked as collation insensitive (CI) and accent sensitive (AS).
Any thoughts on how I can resolve this?
Thanks in advance.
Shane O'Keeffe
I'm getting the following error when performing a deployment of a database package for the first time:
2014-01-23 17:21:35 +00:00 INFO The last deployment details were not found in the target database. Static upgrade is not available 2014-01-23 17:21:35 +00:00 INFO Upgrade script not available; performing dynamic database upgrade 2014-01-23 17:21:35 +00:00 INFO Loading source database from db\state 2014-01-23 17:21:35 +00:00 INFO - Using SOC filter file at db\state\Filter.scpf 2014-01-23 17:21:35 +00:00 INFO - Using default Compare options 2014-01-23 17:21:35 +00:00 INFO - Loading as case-insensitive (based on target database) 2014-01-23 17:21:35 +00:00 INFO Registering target database 2014-01-23 17:21:38 +00:00 INFO Registering scripts folder 2014-01-23 17:21:39 +00:00 ERROR Error while executing job: Dynamic deployment failed 2014-01-23 17:21:39 +00:00 ERROR A duplicate definition was found for the stored procedure [dbo].[<ProcedureName>]. Ensure that case sensitivity options are set correctly and all object creation scripts are valid. If the problem persists, contact our support.
If I re-run the deployment, I get a different object name each time. The database I'm deploying to is marked as collation insensitive (CI) and accent sensitive (AS).
Any thoughts on how I can resolve this?
Thanks in advance.
Shane O'Keeffe
Comments
- The target database already contains objects and is in fact already in sync with the source database that I have checked in to TFS
- I'm running the latest version of Deployment Manager (v2.3.20.2)
- When I run SQL Compare GUI version it finds no differences in the databases
Regards,
Shane.
If you look in the nuget package using Winzip / Nuget explorer, are there multiple sets of scripts?
Redgate Software
When I look in the package file, there are two sets of scripts: one in the \db\state folder and one in the \db\state\Database folder. There is definitely only one set of scripts in TFS.
Can you post a screenshot of your repo folder structure, and also let us know how the VCS root is set up for the TeamCity build (i.e. where in the folder structure the build-step is referring to)
Redgate Software
VCS Root is $/<ProjectName>/Development/Database
Under the plugin, I've set the "Database folder is a subfolder of my build VCS root [?]" option to be "Database"
One suggestion would be to create a new VCS root that goes right down to the second database folder, and then leave the plugin setting at VCS root. This will tell us if there's some weird bug in the plugin where the two folders with the same name cause trouble.
Redgate Software
My build configuration had seperate VCS roots for my database and applications but there are both technically under the same project. The database scripts were being checked out as part of both VCS roots and ending up in different folders so hence the duplicate set of files.
I've simplified the VCS root to be a single location pointing to $/<projectname> and set the plugin to use Database/Database as it's location and I think I'm back on track.
I had to manually delete the previously created packages from the NuGet feed as they contained duplicate script files and the build process started failing at the SQL Compare stage but I think it's all ok now!
Thanks for help!
Redgate Software