using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Management.Smo;
namespace ObjFromUrn
{
  class Program
  {
    static void Main(string[] args)
    {
        Urn urn = new Urn(
         "urn:foo:Server[@Name='CANOPUS5']" +
         "/Database[@Name='pubs']" +
         "/Table[@Name='Authors']"
         );
        Urn urn2 = new Urn(
         "urn:foo:Server[@Name='CANOPUS5']" +
         "/Database[@Name='scratch']" +
         "/Table[@Name='My%20Table']"
         );



       Server server = new Server("CANOPUS5");
       Table t = (Table)server.GetSmoObject(urn);
       Console.WriteLine(t.RowCount);
       Table Authors = (Table)server.GetSmoObject(urn);
       Console.WriteLine(Authors.RowCount);
    }
  }
}
