Wednesday 8 February 2012

Enable Service Broker in SQL Server painlessly

Every so often, I find myself having to create a new testing, staging, whatever non-live environment for an application.  Often I forget that Service Broker needs to be enabled at the database level before it can be used - a database restore doesn't do this.

So often I'm hunting around for a code snippet to enable the Service Broker on a database that's already running (as usually it's the task I've forgotten to do earlier!)

Here's the code snippet:


ALTER DATABASE Titan_Reporting SET SINGLE_USER WITH ROLLBACK IMMEDIATE
GO
ALTER DATABASE Titan_Reporting SET ENABLE_BROKER
GO
ALTER DATABASE Titan_Reporting SET MULTI_USER
GO

Don't forget the 'WITH ROLLBACK IMMEDIATE', otherwise you'll be waiting a looooong time for the first statement to complete! 

Monday 6 February 2012

My new blog

I have a new blog.  It's a place where I write stuff.  It's called 'Data and that.', for want of a better title.  I plan to write lots of informative and insightful stuff about data, its security, working with it, and what advances in data may mean for society in the future.  Hopefully it will stay generally on topic, but I won't guarantee any such thing.  Maybe you'll enjoy reading it, maybe you won't.  You don't have to.

So far this is the only entry.  How many other well-intentioned, single-post blogs are out there, I wonder?  I know I have one or two out there in the cyber-wasteland.  But I have other posts lined up for this one.  I just need to get something posted to start things moving, so this is it.

Here goes...(deep breath)

<PRESSES THE BIG ORANGE BUTTON MARKED 'PUBLISH'>