views:

146

answers:

4

DISCLAIMER: While I'm trying to do this to fool a license enforcement scheme, the company is out of business and I'm only setting up a test server. I don't consider this stealing (as a developer that sells software myself, I wouldn't do that) since I can't pay for another license if I wanted to. However, if the community disagrees, please vote to close this question. Just want to be upfront about this.

We use a server app that, as part of its license enforcement, confirms that "SELECT @@SERVERNAME" matches the license installed on the server. I'm setting up a test instance of this application, but since the license I have is locked to a particular servername, I'm stuck.

Is there a way that I can fool @@SERVERNAME into returning something else? Change the internal name of the server to something different than the DNS name? I know there are SQL Server problems if you rename a server, and maybe I can exploit this to accomplish what I need to (rename the server to the licensed name, install SQL, then rename the server so it doesn't conflict with our production server).

If there is another, non-hacky way to accomplish this (set up an isolated domain, use a virtual server with no network connection, etc), I'd entertain those options as well. What does the community think is the easiest way to get this done?

+2  A: 

I'd probably set up a separate machine or a virtual machine named after what the license manager was expecting. A bit tedious to set up, but it would probably get the job done quicker than looking for hacky solutions. Of course, while the install was running I'd still be looking just in case...

Colin Mackay
This is probably what I'll have to go with - but then I won't be able to remote desktop to it since it will be on the same LAN as the production server, and will screw up DNS...
rwmnau
Another bonus here is that by going with a VM, you can probably keep the software longer if there might be system-level incompatibilities introduced by future OS's/etc... For example, I use QuickBooks 2006 for my (very) small business. It's unusable on my Vista workstation, so it now lives happily in my Hyper-V'ed XP install.
Dave Markle
+1  A: 

You might try using the sp_addserver stored proc on your test server to tell SQL Server that the server name is the one the license is looking for.

From the MS docs,

SQL Server Setup sets the server name to the computer name during installation. To change the name of the server, use sp_addserver, and then restart SQL Server.

David Archer
+2  A: 

It actually looks possible to set the server name property.

SQL 2000: http://msdn.microsoft.com/en-us/library/aa933172(SQL.80).aspx
SQL 2005: http://msdn.microsoft.com/en-us/library/ms174411(SQL.90).aspx
SQL 2008: http://msdn.microsoft.com/en-us/library/ms187944.aspx
Andrew
Golden - this has exactly the effect I wanted, as SELECT @@SERVERNAME now returns the new server name. Stellar!
rwmnau
+1  A: 

Drop the 'local' linked server, then add it back with the name you want. sp_addserver 'foobar', 'local' will make @@server to return 'foobar'. See kb 303774

Remus Rusanu