Archives / 2011 / March

Using New-Object -ArgumentList when the constructor takes one parameter that is an array

Mar 30 2011No Comments by justin

PowerShell is a great scripting language. One of its greatest features is that you have the full power of the .NET framework at your disposal when you use it. However, PowerShell is a dynamically language, and the .NET CLR was designed for static languages. Because of this, sometimes when you call CLR assemblies in Powershell, the types do not get resolved correctly. I ran into this recently while calling New-Object to invoke the MemoryStream constructor that takes an array of bytes as a …

PowerShell Read more

My ideas for The Atlantis Interactive Schema Engine

Mar 27 2011No Comments by justin

I first became aware of the open source Atlantis Interactive Schema Engine on Febuary 24th 2011 thanks to a retweet by Paul Randal. Its a .NET assembly which contains most of the "heavy lifting" code related to the schema operations in their various products. Matt Whitfield, the sole proprietor of Atlantis Interactive, is going to setup an account on codeplex or one of the other forges so people can post bugs, feature requests, and of course patches. Personally, I have several ideas for feature …

Atlantis Interactive, Microsoft SQL Server, Open Source Read more

A BSON ObjectId implementation in Javascript

Mar 26 2011No Comments by justin

Recently I spent a few days implementing the BSON ObjectId data type used by MongoDB in javascript so I could generate ObjectIds in a a web browser. I originally had a specific problem to solve. However, I ended reworking my approach in that instance so I did not have to generate ObjectIds in the browser. Despite this, the code is still a valid approach to solving my original problem. The code is available on the justaprogrammer github org, The project is called ObjectId.js. Although the git …

BSON, javascript, mongodb Read more

How many ways can we 'script' a stored proc or UDF from the command line?

Mar 26 2011No Comments by justin

Update: Added link to the scripts on github. If you've worked with SQL Server for any length of time, you've probably written some stored procedures and user defined functions. If you're like me, you've written many. Usually, when you edit a stored proc or UDF. you do it from Visual Studio or Sql Server Management Studio (SSMS). However, what if you want to script the sproc or udf from the command line? Well, there are quite a few ways to skin this cat, and I'll go through a few. Using sqlcmd …

Atlantis Interactive, batch files, Microsoft SQL Server, PowerShell Read more