Wednesday, December 7, 2011

How To Add new column to existing SQL Server Table

One of my student asked me, he wanted to modify existing SQL Server table by adding new column price (money). Table already has content so he does not want to recreate the table. He tried to use SQL Server Management Studio Table Designer but could not save the modified structure.

Solution : use this select - into query to create new table

Select * , cast(0 as money) as price into dbo.newtable from dbo.oldtable

This query will create new table name dbo.newtable with the structure same as oldtable plus additional new column (price) type money, and populate dbo.newtable from dbo.oldtable content.

Free Microsoft Exam 70-659 TS: Windows Server 2008 R2 Virtualization

My company Ingram Micro Asia Limited, is partnering with Microsoft to offer free exam 70-659 TS: Windows Server 2008 R2 Virtualization

Please visit this link for more detail

Friday, December 2, 2011

Hyper-V Virtual Machine could not be initialized

I am in the middle of setting Microsoft course image on some new machines we rented. The processor was i7. After importing the VMs with recommended procedures, the VMs on new i7 machines cannot be started with the error messages VM could not be initialized.

Solution, we need to tick check box on VM setting :

- Migrate to a physical computer with a different processor version

Tuesday, November 9, 2010

Identifying hot-fixes installed on a system

Microsoft Provides a tool name "Qfecheck.exe", which is used for enumerating installed hot-fixes on a system. However this tool can work only for Windows 2000 and XP.

The complete article and tutorial can be found online here
For later Operating System (2003, Vista, 7 , 2008) ; you can use this WMI command

"wmic qfe".

Thursday, September 16, 2010

How To Prevent Virus Infection on Your USB Drive

We often share files through USB drive and this drive is very vulnerable against malicious code infection. Most of malicious code is infecting your USB drive by creating file name AUTORUN.INF, in most of system (laptop, desktop) this AUTORUN.INF will be read automatically when you plug in the USB drive.

To avoid this type of infection, check your USB drive, if you find AUTORUN.INF exist, delete it. Then create a new folder and name is as AUTORUN.INF.

Now the malicious code can not infect your USB drive as it can not override the existing folder with the same name.

Monday, September 13, 2010

How To Solve Error "Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path"

I have installed MS Visual Studio 2010 Ultimate Edition in Windows 7 Ultimate edition. I created a WCF service and and want to consume the service from Web Application. The WCF is basically read a table from a MS SQL database that instantly attached to SQLExpress when the WCF is started.

I found the WCF service failed to read the data and generate this error message :

"Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed."

After checking MSDN then i found the work around to fix the problem :

1. Open the IIS management console to find which application pool used to start the WCF service

2. Change the Identity to run that application pool to NETWORK SERVICE

3. Restart the IIS Server using this command
net stop iisadmin /y
net start iisadmin /y

Thursday, September 9, 2010

How To Display Original Mail Header in GMAIL

Sometimes we want to analyze the mail header like we want to know from which IP address that email originally came from. In Gmail, you can display complete mail header by choosing the Menu SHOW Original.