Monday, July 27, 2009

Change instance name of SQL Server

It turns out that after you've changed the Windows Server's name, the underlying SQL Server's instance name is not changed accordingly, although you can see an instance name same with the Windows Server's is displayed in the SSMS.

Everything else might work fine until you want to set up replication/distribution on this server. An error message like "SQL Server replication requires the actual server name to make a connection to the server. Connections through a server alias, IP address, or any other alternate name are not supported. Specify the actual server name, ‘old_name’. (Replication.Utilities)" is popped right into your eyes.

To see the old instance name, you can use "sp_helpserver" or "select @@servername" and to change the instance name once and for all, the following script has to be executed:

sp_dropserver 'old_name'
go
sp_addserver 'new_name','local'
go


A detailed and better formatted how-to article can be retrieved from here.

Friday, July 24, 2009

Remote desktop resolution problem

Here is the thing, I use command line short cuts (%windir%\system32\mstsc.exe /v: ) on my desktop to connect to our multiple database server environment and for two days a week, I go to my company and have my laptop docked to a much bigger monitor at the office. So from the bigger screen, the remote session's resolution becomes (automatically) much bigger than my 12 inch laptop's but displays beautifully on the 22 inch LCD screen. But when I come back and start working from home, the RDP session's resolution somehow "remembers" its latest setting and becomes more than my small screen can handle and I have to scroll up and down, from left to right to locate the things I have to work on.

A little bit of research shows that one of mstsc.exe's command line options gives a default full screen setting by using "/f" and I changed all my short cuts on my desktop according to this, and they are all working fine now. So the best practice to use mstsc command line is always put the "/f" argument at the end to ensure the remote resolution is in sync with your local ones in a full screen mode.

IIS logging problem

Although my official title is DBA, but at a small start-up, an "IT dude" is supposed to be capable of solving all kinds of problems which may be way beyond the database realm. And to please our big boss, I happily accepted a task to investigate why one of our IIS websites fails to generate any logging records in the log file directory. What entails is a significant amount of hours which only leads to a simple and stupid overlook by a previous "IT dude" who actually set up the whole website.

The following screen shot from tab "Web Site" on the IIS site properties is a must-go place for checking all the logging settings for IIS and it surely looks perfect on our server.


















However, the other missing check box on the "Home Directory" tab turned out to be the ultimate cause for this site failing to deliver any log files.


Wednesday, July 22, 2009

Two tricks discovered on Dell's Latitude E4300 laptop

The first one is pretty straight forward and probably more Dell-related. I just found out that you can turn off battery charging by pressing Fn+F2 which is an awesome feature because I usually prefer to have my battery on all the time in case there is a power outage, but at the same time, I don't wanna make too much over-charging which might cause a shortened battery life. So having the option of stopping charging the battery is definitely something nice to have. Big applause to Dell's engineers.

The second one is how to type in special signs for example the pound sign £ through a US-layout keyboard. The solution is pretty simple although I've spent quite a load of time Googling for it. First of all, turn on the num lock of the numeric keypad by press Fn+F4 (at least on Dell's Latitude E4300, you can find other key combinations on products from other manufacturers); after this, the num lock blue indicator will be lit up on the upper verge of the keyboard. And then, you can type the key stroke combination Alt+Fn+mjol (for the pound sign) which can be looked up in the "Programs->Accessories->System Tools->Character Map"; combination "mjol" from the normal keyboard is the same as "0163" from the numeric keypad. The second trick comes in handy especially when you have to type such a rarely used character in the password field of windows log-on screen where normal copy and paste does not work.


Friday, July 17, 2009

How to Remove the Windows Genuine Advantage (WGA) Notification Installation Wizard

I am not against Microsoft at all, actually I am pretty much a big fan of MS's products, e.g. SQL Server. But when Windows tries to annoy me with the WGA notification installation wizard, I have to strike back a bit. Here is the link to the video instructions on youtube.

http://www.youtube.com/watch?v=-OaC_9GStUo

Note: this is only for disabling the installation wizard, if you have already installed the WGA notification on your system, then please Google for other solutions.

Monday, July 13, 2009

How to script the schema and/or data from database objects?

Recently, I have been facing an requirement to replicate the same data structure from production to a testing environment in a VM machine. And the data in the production db is too large to be hosed in the VM and only the schema is of more interest for my assignment. Therefore, I did some research into how to actually replicate a database schema from one place to another, which put it another can be referred to as "publishing a database".

A complete answers lies here, but for now I've only tested Microsoft's official "database publishing wizard". Strangely, this wizard does not officially support SQL Server 2008 version yet.

Friday, July 10, 2009

How to upgrade an expired evaluation edition of SQL Server 2008

I recently tried to upgrade SQL Server 2008's evaluation edition to Developer Edition. Since it has been an expired copy, the upgrade although finished with success, the SSMS still kept popping up expiration message. I later did some research on Google and SQLServerCentral, just to find out that no edition upgrade actually upgrade the SSMS and there is some registry modification need to be done for a workaround. This article from Jonathan Kehayias gives a better step-by-step guide to change the registry and after the change is made, you can use the "Edition Upgrade" function from the "Maintenance" page that you can access from the SQL Server Installation Center. One thing to bear in mind is that you have to change the registry first and then run the Edition Upgrade. The sequence can not be reversed.

Two of the most important screen shots are as follows:


Monday, July 6, 2009

How to get Windows to manage wireless network

This is a strange issue that I met recently on my company's laptop that every time I wanna configure in the way that Windows is used to manage the wireless network, the tab "Wireless Networks" on the "Wireless Network Connection Properties" window simply disappears; even after several reboots, it refuses to reveal itself.



















A quick Google search redirects to a forum post and the solution is pretty simple too: just start the Wireless Zero Configuration service either manually or reset it as automatic.