Thursday, September 22, 2011

Uninstalling from Command-line in Windows
The Windows Management Instrumentation Console is the utility provided by Microsoft to remove installed programs/applications from command-line. There are situations where the default uninstall utility chipped with your windows operating system fails to remove some applications that you have either gone berserk or you have tagged "Unwanted". For such situtations, the WMIC could come in handy for this "harvest".

From your command line, perform the following:

1. Type "wmic" without the double quotes;
2. In the wmic prompt, type "product get name " also without the double quotes. This enlists all the installed applications on your system. Locate the application you want to "harvest" and proceed with 3
3. Type "product where name ="" call uninstall". 
For example: product where name="Test Application" call uninstall

Accept the prompt question by supplying a "y". Then you are done.

For applications that are still uninstalled after the above processes, consider using an appropriate 3rd party uninstall utility.

Tuesday, April 05, 2011

In ability to create Database Diagram



If after you attach the MDF of an SQL Server Database, you are unable to create Database Diagrams and you get the following error each time you try:

"TITLE: Microsoft SQL Server Management Studio ------------------------------ Database diagram support objects cannot be installed because this database does not have a valid owner. To continue, first use the Files page of the Database Properties dialog box or the ALTER AUTHORIZATION statement to set the database owner to a valid login, then add the database diagram support objects."


The SQL Server is intelligent and also correct that your newly attached Database does not have a valid owner yet. Therefore, you new to locate a valid user on your SQL Server and assign the database to this user.

Running the following SQL command in your Query Window assigns the database to the user and you should be able to create your diagrams henceforth:

"ALTER AUTHORIZATION ON DATABASE::databaseName TO domain\user"