MERGE is a new feature that provides an efficient way to perform multiple DML operations. In previous versions of SQL Server, we had to write separate statements to INSERT, UPDATE, or DELETE data based on certain conditions, but now, using MERGE statement we can include the logic of such data modifications in one statement that even checks when the data is matched then just update it and when unmatched then insert it.

One of the most important advantage of MERGE statement is all the data is read and processed only once. In previous versions three different statement has to be written to process three different activity (INSERT, UPDATE or DELETE), however using MERGE statement all update activity can be done in one pass of database table. This is quite an improvement in performance of database query.

Read the rest of this entry »

Read the rest of this entry »

Read the rest of this entry »

Recently I am trying to compile a report from MySQL database using “order by” clause to sort the priority_no field. However I discover the result is not in order at all. Then I try to check out the data type of priority_no field and discover that it is configure as varchar. So I just use the quick fix below and got the job done:

mysql> SELECT priority_no FROM table_name ORDER BY priority_no+0;

2009 深圳, 香港, 澳門 汽車展

Read the rest of this entry »

Read the rest of this entry »

About this blog

This is a place I create just for fun and to write down some experience and notes for myself. So feel free to enjoy and drop any comments you have. I had been employed as Programmer, System Analysts, System Administrator, DBA and Project Manager. I will share some of my case study here as well. Enjoy!

Calendar

July 2009
M T W T F S S
« Jun    
 12345
6789101112
13141516171819
20212223242526
2728293031