Monday, May 7, 2012

Disable auto run in Windows XP Home Edition

Have you every try to disable autorun in Windows XP Home edition, If you use a common way using Gpedit.msc you will end up like this.

Have you ever seen this message and stuck with this. Windows home edition does not contain this option, So Gpedit.msc cant be used for disabling auto run in XP Home Edition. You have to do it in the registry editor. 

Back to hardware mode... :)

Here are the steps you have to follow.... (Note: please backup the registry before you proceed)
  1. type regedit and go to - HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer   

                                     
  2. Locate the DWORD value with the name "NoDriveTypeAutoRun", if this value is not there you have to create a new one with the exact same name. To do that right click on the pane -> new -> DWORD value.
  3. Change the value data to - 0x000000b1 (177)
                         

Tuesday, May 1, 2012

Collation conflict in T-SQL

Have you ever encounter a problem when working in T-SQL like, "Cannot resolve the collation conflict between "XX_90_CI_AI" and "SQL_Latin1_General_CP1_CI_AS" in the UNION operation." The reason for this error message is collation conflict has been occurred while SQL server trying to compare two columns or expressions which have different collations. This error cause most of the time when compare columns with a temporary table column, because other table columns are in the database default collation settings and temporary tables may not in the default collation. 

As I experienced to overcome this problem we can simply apply collation setting for the tempary table column with default collation settings as follows

Colname COLLATE DATABASE_DEFAULT from #temp