giovedì 10 marzo 2011

Microsoft SQL (and other programs) crash due to mscorwks.dll

This kind of crash seems to be provoked in systems where several versions of .NET Framework are installed. About my case, I had .Net Framework 2.0 SP1 and .Net Compact Framework 2.0 SP2 (and also 3.0 and 3.5).

Just uninstalling .Net Compact Framework 2.0 SP2 solved the problem :)

In another case that I had, it was way harder, as I was not able to uninstall or reinstall any of the .Net frameworks. Luckily I found here the solution to my problem (http://blogs.msdn.com/b/astebner/archive/2009/02/18/9432938.aspx). It seems there is a tool coming with the framework that allows to you to repair any damaged file/registry key related to the framework.

Ciao!

mercoledì 9 marzo 2011

Erase the duplicates in a DB table (and "copy" tables!)

What if your table has got some duplicates (because you DO NOT define PRIMARY KEYS...)???

Well, we can select distinct rows from the table, and then create a new table with the resultset.
The syntax that we need is the following:

SELECT DISTINCT * INTO [new_table] FROM [old_table]
In addition, if the table already exist, we can use the INSERT INTO command:

INSERT INTO [new_table]
SELECT * FROM [old_table]

That's all!!! :)
when trying to use psexec.exe on a remote machine, it may happen that the following error may occurr:

Logon failure: unknown user name or bad password.


To solve this problem, just change the value in Local Security Policy -> Security options, change:
  • Network access: Sharing and security model for local account (Classic)
...and that's all!!! :)