Creating Understanding and Educating Programmers, Developers and Technical Communities, one post at a time.

Thursday, February 24, 2011

Linked Server

I was looking for a linked server in SQL management studio. I can see bunch of linked server but not sure which one I needed.

I found out that following query not only list the linked server name, but also server name, database name information.

Here is the query.

SELECT * from sys.servers
WHERE is_linked = 1

Happy SQLing!!

Wednesday, February 16, 2011

ISNULL

ISNULL ( check_expression , replacement_value )

Today, I am writing my thoughts on T-SQL specific function isnull(). Current database system allows null values. Null itself does not show any meaning but when end users need data reports/application require data then it becomes problem.

ISNULL function convert null values into meaningful data value. Isnull function checks expression and if it founds null then replace it with second argument (replacement value expression) otherwise return first argument.

We still have coalesce() and nullif() functions to control null values in more flexible way.