Testimonials

What our customers are saying

"You're the best I have."


- D. Barton, Global Oracle Consulting Firm

about us

Service Delivery

Multiple ways to access M&S

M&S offers technology and process solutions through multiple offerings and vehicles. End-to-end solutions, training and mentoring, staffing, ongoing support.

read more

Effective and Efficient

Exceptional Results

M&S today reflects a rare combination of out-of-the-box thinkers, deep business acumen, enterprise architectural design/engineering, and software prowess.

contact us

From the M&S Blog...

IE6 is [almost] dead – Usage is 2.4% in USA, 34.6% in China

It’s not just web 2.0 developers making the push away from IE6 anymore. Microsoft is publishing the stats, and even they want people off of Internet Explorer 6 (IE6).

Join the cause by pasting your own “STOP using this out-of-date browser” banner (provided by Microsoft):

<!--[if lt IE 7]> <div style=' clear: both; height: 59px; padding:0 0 0 15px; position: relative;'> <a href="http://windows.microsoft.com/en-US/internet-explorer/products/ie/home?ocid=ie6_countdown_bannercode"><img src="http://www.theie6countdown.com/images/banners/warning_bar_0000_us.jpg" border="0" height="42" width="820" alt="You are using an outdated browser. For a faster, safer browsing experience, upgrade for free today." /></a></div> <![endif]-->

IE6 usage is trending down, at 11.4% today compared to 18.7% one year ago:

China, South Korea, and India are the top 3 countries using IE6:

SSIS Tip – Xpath for Root Level Attributes (XML Tasks)

For some reason, SSIS’s XML Data source does not allow you to directly access root level attributes. Therefore, we’ve got to use a XML Task and variables in order to pull this data in.

  1. Create a variable for every attribute, use the string data type (change later in data flow if need be)
  2. Use the following example (fill your own Xpath in the Second Operand)

This example will only pull in one value. Should there be multiple attributes with the same name, you’ll have to use a Foreach loop.

SSIS Tip – Xpath from a C# Script Task

At some point you may need to use Xpath from within a script task rather than using Integration Services built in XML Task’s Xpath functionality. Here’s how I implemented it. The primary limitation is that it will only return a single value, but this can be adjusted to return multiple values easily.

Chances are you’ll already be using a  script task, but incase you don’t, start with a standard Script Task (this can be either a Control Flow Script Task or a Data Flow Script Task). Don’t forget to set your ReadOnly / ReadWrite variables.



Here’s the boilerplate code for using Xpath in a script task

XmlDocument doc = new XmlDocument();
public void Main()
{
    sampleUrl = http://www.example.com/sample.xml;
    doc.Load(sampleUrl);
    int id = 5;
    string roll = Xpathquery("/people[@id=”+id+”]/@roll"); // This will find the @roll attribute where the id attribute is 5.

    //TODO: Write the string to a SSIS variable or do with it what you’d like.

    Dts.TaskResult = (int)ScriptResults.Success;

}

public string Xpathquery(string xpath)
{
    XPathNavigator nav = doc.CreateNavigator(); // Compile a standard XPath expression
    XPathExpression expr;
    expr = nav.Compile(xpath);
    XPathNodeIterator iterator = nav.Select(expr);
   //Iterate on the node set
       try{
            while (iterator.MoveNext())
                {
                    XPathNavigator nav2 = iterator.Current.Clone();
                    return nav2.Value;
                 }

             }
            catch (Exception ex) {
                Console.WriteLine(ex.Message);
                return null;
             }
    return null;
}

SSIS Tip – Read from Variables to Rows in Data Flow using Script Task

Reading from variables to augment rows with data from variables isn’t readily apparent in SSIS. A workaround I found was to use a script task right before your OLE DB Destination and access the SSIS variable objects directly.

Script Task Setup

  1. Start with a standard Script Task in your data flow.
  2. Add columns to your output in the ‘Inputs and Outputs’ tab, set the names and output data types appropriately
  3. Access Variables in your ‘main’ script section by using the following code
IDTSVariables100 vars = null; //Gets reference to the SSIS Variables
this.VariableDispenser.LockOneForRead("session", ref vars);//Locks the Variable in quotes, for Read ….use LockOneforWrite to write to variable
string temp = (string)vars[0].Value;//Assigns to value to a string
Row.sessionId = Convert.ToInt32(temp);//converts to Int
vars.Unlock();//Unlocks the var.

SSIS Tip – Save Package to MS SQL Server (Integration Services)

In order to save your SSIS package built using Business Intelligence Development Studio (BIDS) to Integration Services MSDB, you’ll need to:

  1. In BIDS, right-click the solution and select Properties
  2. Under Deployment Utility, change the CreateDeploymentUtility option from False to True
  3. Rebuild the solution
  4. Now find in your solution project folder under the bin\deployment file path an Integration Services Deployment Manifest. Right-click this manifest file and select Deploy.

Follow the wizard steps to deploy to your server and choose where to save to the database. The package should then appear in SSIS in SQL Server Management Studio under Integration Services in /MSDB.

Request XML from URL in SSIS C# Script Task

Occasionally, I’ve needed to pull XML from the internet via an URL. This allows you to dynamically pull XML from sources than your local.In order to do so, you’ll need a string variable (to populate with the XML from the internet) and the code below in a Script Task.

Every time you need to reference the XML in the variable, change your XML Data Sources and XML tasks to pull XML from a variable.

string Url = (string)Dts.Variables["Url"].Value;
XmlDocument doc = new XmlDocument();
doc.Load(Url); //You can use a string here if you’d like…I pull from a variable for the URL
StringWriter sw = new StringWriter();
XmlTextWriter xw = new XmlTextWriter(sw);
doc.WriteTo(xw);
sw.ToString(); Dts.Variables["Xml"].Value = sw.ToString();

SQL Server Management Studio Shortcut Keys

Here are quick shortcut keys I use when using SQL Sever Management Studio’s query editor (I happen to be on version 2008 R2).

  • Comment selection: CTRL-K, C (while holding CTRL)
  • Uncomment selection: CTRL-K, U (while holding CTRL)
  • New Query Editor Window: CTRL-N
  • Find: CTRL-F (F3 for next occurrence, SHIFT-F3 for previous occurrence)
  • Replace: CTRL-H
  • Word completion: ALT+RIGHT ARROW
  • List members: CTRL-SPACE
  • Next Editor Window: CTRL-TAB (previous CTRL-SHIFT-TAB) —- this works like Textpad

These are some of my favorites out of the full list of SQL Server Management Studio shortcuts published by Microsoft.

More to come in an update, but wanted to get these listed here in draft form to help my team members and perhaps others on the internet that like to have efficient text editor capabilities in the RDBMS IDEs.

Show line numbers with Tools > Options > Text Editor > All Languages > Display > Line Numbers (as below):

SharePoint Editions – Version Naming: WSS, Services, Foundation, Server, MOSS, 2003, 2007, 2010

I talk to many customers who have trouble understanding the Microsoft SharePoint versions that have existed since around 2003, so I have provided a very simple chart with the various naming conventions used in the industry.

read more