Thursday, September 28, 2006

Ashi has came back...

One of ma good friend; ashini(Akki) has came back to blogging again ('coz of my request. ;-) ) She's a very close friend of mine and a good sister for me. I always try to accept all her advice ;) (even though you think you are not a good adviser. lol...) and those advice is worth for me. I have changed some qualities of mine. he he he... As my knowledge we don't know how much we are worth for others. So you have to start a new blog life with all your thoughts, and with your knowledge (which is being updated daily... ). So wish you all the best Akki !!!

You can visit her blog.... http://ashinie.blogspot.com/

Thursday, September 21, 2006

Common Table Expression(CTE)

This is a new Enhancement of SQL server 2005(as my knowledge).we can think CTE's as a simple and more powerful alternative to derived Tables.In my case Now I am using CTE's where I used Temporary Tables before and I replaced so many views.

A CTE can be defined as a temporary named result set, which is derived from a simple query and defined within the execution scope of a SELECT, INSERT, UPDATE, or DELETE statement. It is important to note that the scope of a CTE is just the statement in which it is declared. The CTE named result set is not available after the statement in which it is declared and used.

Here I am putting a code sample for CTE witch I have taken from AdventureWorks Database then you all can check this SQL script in your SQL server 2005(if you have installed AdventureWorks DB.)


WITH YearlyOrderAmtCTE(OrderYear, TotalAmount)
AS
(
SELECT YEAR(OrderDate), SUM(OrderQty*UnitPrice)
FROM Sales.SalesOrderHeader AS H JOIN Sales.SalesOrderDetail AS D
ON H.SalesOrderID = D.SalesOrderID
GROUP BY YEAR(OrderDate)
),
SalesTrendCTE(OrderYear, Amount, AmtYearBefore, AmtDifference, DiffPerc)
AS
(
SELECT thisYear.OrderYear, thisYear.TotalAmount,
lastYear.TotalAmount,
thisYear.TotalAmount - lastYear.TotalAmount,
(thisYear.TotalAmount/lastYear.TotalAmount - 1) * 100
FROM YearlyOrderAmtCTE AS thisYear
LEFT OUTER JOIN YearlyOrderAmtCTE AS lastYear
ON thisYear.OrderYear = lastYear.OrderYear + 1
)
SELECT * FROM SalesTrendCTE
GO

Monday, September 18, 2006

Down with a fever... and now Gastritis....

Now I feel bit better after the fever since last Wednesday. I wanted to be @ office last thursday and friday coz I had to complete something with new SQL Report server. But I couldn't make it. After the fever last friday i got Gastritis also. Now I have to take medicine for Gastritis too.That's a damn sickness. NowI feel bit better. And now I am trying to Eat on time. And I am warning you all my buddies. Please take care of your meals. Simply EAT ON TIME.

Tuesday, September 05, 2006

Microsoft .NET Framework 3.0

Microst has Released Microsoft .NET Framework 3.0(pre-Released) for the general public.(May be this an Old news ;) ).We can download new framework and Related resources from here. and also we can download RC1 SDK tooo.Wow.....