Windows 8: shutdown/restart tile

Wow…the Script Center was a great site. Loads of nice script for whatever you need in a Microsoft environment. One script that caught my eye was a powershell script for creating showdown and restart tiles in Windows 8.

I first got the error message: “cannot be loaded because running scripts is disabled on this system

This was resolved by the following powershell command: set-executionpolicy remotesigned

After this I ran the following commands

  • New-OSCWindowsTile -ShutdownTile
  • New-OSCWindowsTile -RestartTile

And finally, I moved the tiles at the beginning of the “Start Menu”….Nice 🙂


SQL Server: paging

I’m having a reading session for the 70-461 SQL exam this afternoon, and encountered a new feature that I have missed for some year. I’m not sure if this is a new feature in SQL Server 2012, yet, but is pretty equal to the syntax given in Entity Framework and LINQ (101 LINQ Samples).

Let’s say you want to retrieve orders in a paged manner to reduce the network overhead.

DECLARE @pagesize AS bigint = 25 ;
DECLARE @pagenum AS bigint = 3 ;
SELECT orderid, orderdate, custid, empid
FROM Sales.Orders
ORDER BY orderdate DESC, orderid DESC
OFFSET (@pagenum – 1) * @pagesize ROWS FETCH NEXT @pagesize ROWS ONLY ;