Grouping Set in SQL Server 2008– Another example
Posted: June 2, 2011 Filed under: SQL Server 2008 Leave a comment—SQL Server 2008
create table Transport (id int identity(1,1), TransporterId int,
VehicleNo varchar(50), PetrolConsumed int, TotalCost int)
insert into Transport values (1,’ABC-123′,15,900)
, (2,’XYZ-654′, 20,1200)
, (1,’MNB-592′,18,1080)
, (2,’XYZ-654′,15,900 )
, (3,’PQR-604′,20,1200)
SELECT TransporterId,Isnull(VehicleNo, ‘Total—–‘)AS VehicleNo
,Sum(PetrolConsumed) AS PetrolConsumed
,Sum(TotalCost) AS TotalCost
FROM Transport
GROUP BY grouping sets( ( TransporterId, VehicleNo, PetrolConsumed, TotalCost ), ( TransporterId ) )
Order By TransporterId
drop table transport
Turn off a Child Portal in DNN (DotNetNuke)
Posted: June 2, 2011 Filed under: DotNetNuke (DNN), IIS 7 URLRewrite 1 CommentSometimes you may have a need to turn off a child portal for sometime without using the expiration date host setting.
There is an easy way to do it with IIS’s URLRewrite module.
Here is an example code in web.config file:
<system.webServer>
….
<rewrite>
<rules>
<rule name=”RedirectChildPortal” stopProcessing=”true”>
<match url=”^myChildPortal/$” />
<conditions>
<add input=”{REQUEST_FILENAME}” matchType=”IsFile” negate=”true” />
</conditions>
<action type=”Redirect” url=”SomePage.htm” />
</rule>
</rules>
</rewrite>
</system.webServer>
<system.web>
…..