Monday, 6 June 2011

Restoring a SQL database with active users

Sometimes it is necessary to restore a database that has users currently active inside it. Use the following SQL in order to achieve this...

USE [master]
GO
ALTER DATABASE [myDatabaseName] SET  SINGLE_USER WITH ROLLBACK IMMEDIATE
GO

RESTORE DATABASE [myDatabaseName] FROM  DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Backup\myDatabaseName.bak' WITH  FILE = 1,  NOUNLOAD,  REPLACE,  STATS = 10
GO


USE [master]
GO
ALTER DATABASE [myDatabaseName] SET  MULTI_USER WITH ROLLBACK IMMEDIATE
GO

Is XAML / Silverlight no longer?

Window 8 preview, seems to be based largely on HTML5 and JS...

http://www.microsoft.com/presspass/features/2011/jun11/06-01corporatenews.aspx

Increasing WCF performance

Last week a colleague of mine discovered that for each WCF call, there are actually 2 round trips between client and the server going on using wireshark. This can especially be bad where the network latency on your site is also high, as for each request for data, there is the first call to authenticate the user, which then needs a reply back, then the actual call to get the data, which of course comes back as well, hence 4 x the network latency.

There are some solutions to this e.g. using a Secure Token Service, see http://msdn.microsoft.com/en-us/library/ee748498.aspx for more detail.

There is however an alternative to this which could provide better performance from http://www.noemax.com/

How to find the last interactive logons in Windows using PowerShell

Use the following powershell script to find the last users to login to a box since a given date, in this case the 21st April 2022 at 12pm un...