Thursday, April 7, 2011

Common Table Expressions make your SQL simple and readable


USE AdventureWorks2008R2;
GO
-- Define the CTE expression name and column list.
WITH Sales_CTE (SalesPersonID, SalesOrderID, SalesYear)
AS
-- Define the CTE query.
(
    SELECT SalesPersonID, SalesOrderID, YEAR(OrderDate) AS SalesYear
    FROM Sales.SalesOrderHeader
    WHERE SalesPersonID IS NOT NULL
)
-- Define the outer query referencing the CTE name.
SELECT SalesPersonID, COUNT(SalesOrderID) AS TotalSales, SalesYear
FROM Sales_CTE
GROUP BY SalesYear, SalesPersonID
ORDER BY SalesPersonID, SalesYear;
GO


Reference:
http://msdn.microsoft.com/en-us/library/ms190766.aspx

Develop ASP.NET in your browser, CodeRun Studio IDE

Try it:
http://www.coderun.com/ide/

SQL Server 2008 Data Types without Entity Framework 4 support

geography
geometry
hierarchyid
sql_variant

Defending against Lizamoon Attack - "Peter and the case of the ASP.NET developer"

Defending against Lizamoon Attack - "Peter and the case of the ASP.NET developer"

IIS 7.0 Extensionless UrlRewriting (Short urls)

IIS 7.0 Extensionless UrlRewriting (Short urls): "IIS 7.0 Extensionless UrlRewriting (Short urls)"

How to use OpenID in ASP.NET WebForms

Integrating OpenID in ASP.NET Web Forms using DotNetOpenAuth



http://bhaidar.net/post/2011/04/04/OpenID-Single-Sign-On-ASPNET-Web-Forms.aspx