Team City plugin drops database
nforss
Posts: 3
Hi,
I've been trying to get SQL Source Control to work together with Team City using the plugin provided by Red Gate. My problem is that even though the plugin configuration explicitly states that the runner wont create the database for me, it first drops the db and then tries doing exactly that. (The sql server user account does not have permission to create a new db.)
The error message in the Team City log looks like this
Any help would be appreciated!
/Nicklas
I've been trying to get SQL Source Control to work together with Team City using the plugin provided by Red Gate. My problem is that even though the plugin configuration explicitly states that the runner wont create the database for me, it first drops the db and then tries doing exactly that. (The sql server user account does not have permission to create a new db.)
The error message in the Team City log looks like this
[09:44:47]Step 12/17: Build database from source control (Red Gate (SQL Server)) [09:44:47][Step 12/17] Starting: C:\TeamCity\buildAgent\plugins\RedGateSQLServer\assets\sqlCI.exe /scriptsFolder=Database /databaseServer=SERVER /databaseUserName=USERNAME /databasePassword=PASSWORD /databaseName=staging /packageRepository=null /packageId=staging /packageVersion=243 [09:44:47][Step 12/17] in directory: C:\TeamCity\buildAgent\work\394b341d423ece2d [09:44:48][Step 12/17] [09:44:48][Step 12/17] Unhandled Exception: System.Data.SqlClient.SqlException: CREATE DATABASE permission denied in database 'master'. [09:44:48][Step 12/17] at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) [09:44:48][Step 12/17] at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) [09:44:48][Step 12/17] at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) [09:44:48][Step 12/17] at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout) [09:44:48][Step 12/17] at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) [09:44:48][Step 12/17] at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() [09:44:48][Step 12/17] at ##.#PCSc(SqlConnection #Gjoc, #WrPb ) [09:44:48][Step 12/17] at #WMRc.#WrPb.#8vSc() [09:44:48][Step 12/17] at #JMRc.#NNd.#yMSc(#IMRc #gnSc, #LQRc #AfSc, #TMRc #vhSc, #lO3 #qBSc, #MHTc #RHTc, #MHTc #SuUc) [09:44:48][Step 12/17] at ##.#2MRc(String[] #ead) [09:44:53][Step 12/17] Process exited with code 255 [09:44:53][Step 12/17] Step Build database from source control (Red Gate (SQL Server)) failedWhat is going on here? If I don't create the database, the plugin complains about it not being found. The configuration is so very simple I really don't see a way I could be misunderstanding it.
Any help would be appreciated!
/Nicklas
Comments
In my case, the plugin drops the DB has some strange sync failure and leaves the DB empty.
Another interesting note. The sync fails but the build is reported as successful.
createnew
upgrade
and else.
Does anyone know what I can change to affect these options. In my case, I want to do upgrades and not createnew. Is this not the right forum for these issues?
The next version of the plugin will also provide an option to specify a database that is simply kept up to date incrementally with the latest changes. If you could hold out for the next plugin then I think it will work for you.
Another option is to not use the plugin for this scenario and call in a separate command line build step:
sqlcompare.exe /scripts1:<yourscriptsfolder> /s2:<yourserver> /db2:<yourdatbase> /sync
Product Manager
Redgate Software
Is this the proper forum for the Team City plugin. I have some other errors I'm seeing but I'm not sure where to post them.
Thanks,
Doug
Product Manager
Redgate Software