How to set the Localdb instance name in the TeamCity plugin?
swinghouse
Posts: 120 Bronze 2
Hi,
After upgrading from SQL Server 2012 Express to 2014 Express on our build server, the TeamCity build projects that utilize the Red Gate SQL CI Build plugin, fails with the following message:
This makes sense since SQL Server 2012 was bundled with Localdb v. 11.0 and SQL Server 2014 comes with Localdb v. 12.0.
However, I can't figure out how to set the temporaryDatabaseServer option mentioned in the error message?
/Mattias
After upgrading from SQL Server 2012 Express to 2014 Express on our build server, the TeamCity build projects that utilize the Red Gate SQL CI Build plugin, fails with the following message:
Starting LocalDB failed with error: Could not start LocalDB: Unexpected error occurred inside a LocalDB instance API method call. See the Windows Application event log for error details.
. Ensure that localDB is installed and that it is possible to start the default instance using the command 'sqllocaldb start v11.0', or specify a different temporary database server by setting the option 'temporaryDatabaseServer'
This makes sense since SQL Server 2012 was bundled with Localdb v. 11.0 and SQL Server 2014 comes with Localdb v. 12.0.
However, I can't figure out how to set the temporaryDatabaseServer option mentioned in the error message?
/Mattias
Comments
If you want to specify a particular localdb instance then you should be able to use the temporary database option in the same way you would for a regular SQL Server.
Redgate Software
Thanks for the answer!
However, after configuring my build step as per your recommendation I get another error message when I run the build in TeamCity:
Connecting to LocalDB directly from SSMS on the build server with Windows credentials works fine.
What could be the wrong?
/Mattias
On your build agent, the tools are almost certainly being run under a system account so that might be causing issues with localdb if that was installed under a different account.
It might be easier to use a proper SQL Server instance.
Redgate Software
Yes, switching to a proper SQL Server instance did the trick - thank you!
I have one minor concern with this solution: In the GUI for the TeamCity plugin, LocalDB is singled out as the recommended option.
What's the reason behind this recommendation? Is it because LocalDB is a lightweight alternative to a full-blown SQL Server installation and thus offers a lower footprint on the build server?
/Mattias
It's mainly for ease of setup. You don't really have to configure anything if you're using localdb. It's much easier to get started with.
If you want more control over the temporary database or you're using functionality that localdb doesn't support, then SQL Server would be a more appropriate choice.
Redgate Software
Thanks, I think we've covered my questions about Localdb now.
/Mattias