Re: Yukon:Regress or progress - you decide
From: Adam Machanic (amachanic_at_air-worldwide.nospamallowed.com)
Date: 03/04/04
- Next message: Joe Celko: "Re: Recursive Query"
- Previous message: TJ: "Re: Funky order by ..."
- In reply to: Dr. StrangeLove: "Yukon:Regress or progress - you decide"
- Next in thread: Joe Celko: "Re: Yukon:Regress or progress - you decide"
- Reply: Joe Celko: "Re: Yukon:Regress or progress - you decide"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 4 Mar 2004 12:09:20 -0500
I'm more concerned about the ability to write stored procedures in *any* CLR
language... C# and VB.Net are not declarative, set-based languages. Think
cursors are overused by naive developers today? Just wait....
"Dr. StrangeLove" <steve.nospam.@rac4sql.net> wrote in message
news:eddSJGgAEHA.1732@TK2MSFTNGP12.phx.gbl...
> The following can be found at:
> http://www.developer.com/db/article.php/10920_3099771_1
>
> "SQL Server "Yukon" now has a robust development environment that allows
> programmers to branch out into the world of data. Many of these people
have
> only learned what they need to know in order to coexist with the database.
> SQL Server "Yukon" is blurring the line between being a developer and a
> database person. For me, it is the best things since sliced bread, because
> it combines the two technical joys of my life - development and database
> work."
>
> Just what Joe C., Fabian Pascal and Anith want to hear!:)
>
> "Many of these people have only learned what they need to know
> in order to coexist with the database."
> Sadly true and the reason d'etre of the ng:)
>
> And while were at it:
>
> " T-SQL now has the ability to pivot and unpivot data. No more dynamic
T-SQL
> or overly complex SELECT statements - now you can use this new ability to
> create crosstabulated data results. These two SELECT statements will give
> the same results, but obviously, the second is a lot easier to write,
> especially if we are dealing with more than three pivoted output columns.
>
> SELECT ProductID, ProductName,
> SUM(CASE TheYear WHEN 1996 THEN Extended ELSE 0 END) AS [1996],
> SUM(CASE TheYear WHEN 1997 THEN Extended ELSE 0 END) AS [1997],
> SUM(CASE TheYear WHEN 1998 THEN Extended ELSE 0 END) AS [1998]
> FROM vwOrderDetails
> GROUP BY ProductID, ProductName
>
> SELECT * FROM vwOrderDetails
> PIVOT (SUM(Extended) FOR TheYear IN ([1996], [1997], [1998])) AS PVT "
>
> This doesn't even come close to the *Access* crosstab.
> RAC anybody?:)
>
> " Common Table Expressions are new to SQL Server "Yukon" as well. At
first,
> they appear to be another means of creating derived-tables, and they do
> indeed possess many of the same qualities. But, more in-depth research
shows
> that they also give us the ability to write recursive queries. So if we
want
> to iterate up or down a hierarchal table structure, we can create a query
> that references itself and will recurse as needed (with a default maximum
of
> 100 levels deep) or until we specify otherwise. The following example uses
> the Employee table in the Northwind database to demonstrate how to find
all
> employees and their managers, and those managers' managers, etc....
>
> WITH EmpCTE (EmpID, EmpName, MgrID, Level)
> AS
> (SELECT E.EmployeeID, E.LastName, E.ReportsTo, 1
> FROM Employees E
> WHERE ReportsTo IS NULL
> UNION ALL
> SELECT E.EmployeeID, E.LastName, E.ReportsTo, Level + 1
> FROM Employees E
> INNER JOIN EmpCTE ON EmpCTE.EmpID = E.ReportsTo
> WHERE Level <= 5)
>
> SELECT EmpID, EmpName, MgrID, Level
> FROM EmpCTE "
>
> Copied right out of DB2 and probably just as slow:)
>
> Just some brainfood for those that are hungry:)
>
> RAC v2.2 and QALite @
> www.rac4sql.net
>
>
>
>
>
>
- Next message: Joe Celko: "Re: Recursive Query"
- Previous message: TJ: "Re: Funky order by ..."
- In reply to: Dr. StrangeLove: "Yukon:Regress or progress - you decide"
- Next in thread: Joe Celko: "Re: Yukon:Regress or progress - you decide"
- Reply: Joe Celko: "Re: Yukon:Regress or progress - you decide"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|