Monday, August 30, 2010

Regular Expressions in SQL 2008 R2

At last! Supported, official regular expression support in SQL Server! It’s a bit of a hack, so I may have to redact the “supported” comment. But here are the fully-documented scripts you get when you install Master Data Services on SQL 2008 R2.

Here’s how to extract them and use them on your own database (only tested on R2, but I suspect any edition of SQL server that supports the CLR would work with these; you will need R2 to install MDS, however):

  • Install MDS from D:\MasterDataServices\x64\1033_ENU
  • Run the Configuration Manager and set up a new MDS database. You will be copying from here and into your own database.
  • Script the Microsoft.MasterDataServices.DataQuality assembly (right click / Script as / Create)
    image
    image
  • Change the AUTHORIZATION to db_datareader
  • Find the functions you need (most under scalar, some under table), and right click, script, create:
    image
    image
  • Delete the USE block, and change the namespace to dbo, or one of your own.
    image
  • Run all of the scripts on your own database, starting with the assembly.

Saturday, August 21, 2010

Tomato & Grape Fresh Chutney

  • Handful of cherry tomatoes, quartered
  • Handful of white sweet grapes, halved
  • Good splash (~1T) of champagne vinegar (other white or rice would work fine)
  • Little olive oil
  • Teaspoon of salt
  • Generous sprinkle of curry powder
  • Generous sprinkle of garam masala
  • A little habanero for bite, finely minced
  • 1 clove garlic, pressed

Mix everything but garlic. Simmer and mush in a pan over medium heat until most of the fruit has separated from the skin. Run through a blender to improve consistency if desired. Return to pan, add garlic, simmer for one minute longer. Serve over pork chops. We loved it.

Space Pen

You know that frustrating feeling when you pick up a pen and it doesn’t write? You scribble and shake it, but it doesn’t do much.

I decided a while ago to try one of those “space pens” to see if its pressurized ink cartridge would solve that problem, and it 100% does. If you want an inexpensive pen that reliably writes the first time, every time, with a continuous, even flow, check these guys out. I went with this model, which fits in my pocket when closed and opens to a comfortable writing size. It’s still just a ballpoint pen and writes like one, but it has a nice weight and balance. All for under $11. Worth every penny.

Fisher Space Pen, X-Mark Bullet Space Pen, Matte Black (SM400BWCBCL)

Tuesday, August 10, 2010

Salmon Marinade and Glaze

  • Soy sauce
  • Maple syrup
  • Lime juice
  • Sriracha chili sauce
  • Finnish Mustard (or medium-sweet brown mustard)

Marinate a chunk of salmon. Baste.

With excess, add a splash of arrowroot or cornstarch, mix well, and then reduce to a molasses consistency. Remove from heat and add a bit of butter.