EntropyZero Blogging Server

Welcome to EntropyZero Blogging Server Sign in | Join | Help
in Search

dataFresh - a new database rollback library for unit tests

Quickly put your database into a known state for testing.

dataFresh issues after computer rename!

We recently had one of our development pairing stations rebuilt.  When we got the new machine it was setup with some random name.  In the spirit of consistency, Stephen and I decided to rename the machine to something more in line with our other pairing workstations.  I've never been a big fan of renaming machines especially when Microsoft SQL Server was already installed.  In this case since we just started working on this box and had not yet installed IIS and basically everything else, we decided that it would be OK.

We finally got all our software installed and were ready to start developing.  We run our test fixtures that build out the database.  Part of the new database initialization is a dataFresh restore that imports all the lookup data for the system.  It would stop at this point and not provide any error.  It seemed like dataFresh would just freeze.  After a little bit of examining our procedures, I noticed a call to @@ServerName that is used to identity the server for authentication purposes.

SELECT @@ServerName

When I executed the above SQL statement, it returned the old name of the machine.  Ah ha!  The @@ServerName function stores the computer name during SQL server installation and must be changed after renaming your computer.  To do this, I used the following SQL statements.

exec sp_dropserver '<old machine name>', null

exec sp_addserver '<new machine name>', 'local', null

<restart MSSQLSERVER service>

After restarting the server, I ran my tests again and this time dataFresh populated the lookup data, we were back in business!

 

 

Published Sunday, September 24, 2006 12:12 PM by mike.brockey
Filed under: , ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

No Comments

Leave a Comment

(required) 
(optional)
(required) 
Submit
Powered by Community Server, by Telligent Systems