using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Management.Smo;
namespace DrillIntoHier
{
    class Program
    {
        static void Main(string[] args)
        {
            Server server = new Server();
            Console.WriteLine(server.Information.Product
              + " " + server.Information.ProductLevel
              + " " + server.Information.VersionString);
            foreach (Database db in server.Databases)
            {
                Console.WriteLine("Database: " + db.Name);
                foreach (Table tb in db.Tables)
                {
                    Console.WriteLine("  Table: " + tb.Name);
                }
            }
        }
    }
}
