“SQL Server 2005 Express tools" failed while installing SQL Server 2008 Express Edition.

Saturday, May 26, 2012 0 comments

Today morning when I am going to install SQL Server 2008 R2 Express edition, I am getting below error.
Rule "SQL Server 2005 Express tools" failed.

The SQL Server 2005 Express Tools are installed. To continue, remove the SQL Server 2005 Express Tools.


Solution:

I am just trying to solve this issue By following the steps described. I want to keep SQL Server 2005 and SQL Server 2008 both on my PC. I am going to explain one trick through which you can keep and work on both SQL server 2005 and 2008 and installed on the machine at the same time. The trick is simple, just change a registry directory name of the SQL server 2005 studio with registry editor. Follow the below step.

1. Go to Windows > Run, enter “regedit” and click ok.
2. Browse to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\90.
3. Rename “90″ to something else, like “old”

After the installation, make sure you have to change it back.

You can now rerun the process in the SQL Server 2008 Express installation wizard. After installation completed, you will notice that the old SQL Server 2005 doesn’t run when you try to launch it. No worry, to fix it you can change the newly created directory “90″ to “70″. Then change “old” that you changed from “90″ before back to “90″. It should now work for both SQL Server 2005 and 2008 Studio Express.

Enable CLR in SQL Server

0 comments

The common language runtime (CLR) integration feature is off by default, and must be enabled in order to use objects that are implemented using CLR integration. To enable CLR integration, use the clr enabled option of the sp_configure stored procedure:

sp_configure 'show advanced options', 1;

GO

RECONFIGURE;

GO

sp_configure 'clr enabled', 1;

GO

RECONFIGURE;

GO

You can disable CLR integration by setting the clr enabled option to 0. When you disable CLR integration, SQL Server stops executing all CLR routines and unloads all application domains.

Note: To enable CLR integration, you must have ALTER SETTINGS server level permission, which is implicitly held by members of the sysadmin and serveradmin fixed server roles.

What is NULL?

Thursday, May 24, 2012 0 comments


Most of them always confused that NULL is false, absent of value. There are few properties of the NULL are universal but the knowledge of the same is not universal.
Let us run following very simple query. Run following T-SQL script.
SELECT SUM(data)FROM (SELECT NULL AS data) t
It will return following error:
Msg 8117, Level 16, State 1, Line 1
Operand data type NULL is invalid for sum operator.
Now error itself explain, here NULL is not the type of Integer by default. We must have to convert it in Integer by casting.
SELECT SUM(data)FROM (SELECT CAST(NULL AS INT) AS data) t
Now when we run this above query we will get NULL value as below.

Most the the SQL Developer convert NULL to 0 by using ISNULL function. But It will produce the different result.
SELECT SUM(data)FROM (SELECT ISNULL(NULL,0) AS data) t
Output would be as below.

Here I just want to explain that NULL can be converted in any type like int, varchar, decimal etc. and perform your action according the datatype query.
CAST(NULL AS INT)
CAST(NULL AS VARCHAR)
CAST(NULL AS DECIMAL)
One more interesting point regarding NULL is that when you add or concatenate anything with NULL, output would be NULL.
SELECT 5 + NULL
SELECT 5 + CAST(NULL AS INT)
OR
SELECT 'Anjum' + NULL
SELECT 'Anjum' + CAST(NULL AS varchar)
Output would be NULL.
I am confident that after reading the post you will have no confusion regarding NULL in future.