Tuesday, August 21, 2012

Installing Windows 8 Enterprise and Activation Error

After installing Windows 8 Enterprise edition, I received the following error:

Windows can’t activate right now. Please try again later.

Trying later results in the same message.  The problem turns out to be that the system need a product key.  To do this, simply run an elevated command prompt and type:

slmgr.vbs –ipk “ENTER PRODUCT KEY”

Once this is done, you will be able to activate Windows (and on mine, it was already activated when I went to the activation center).

Tuesday, August 7, 2012

Delimited List of Columns

I frequently need to get a list of columns of a database table in a delimited format, and have found myself rediscovering the following query:

select '['+ [name] + '],'

from sys.columns

where object_name(object_id) = 'table-name'

order by column_id

for xml path('')


For a table with three columns, the return from the above would be:

[Column1],[Column2],[Column3],

Enjoy!