This command line application was designed to perform two task, generate a Json schema of a database, and compare the generated schemas to report the difference between them.
in my current company we often have the specific need to be able to compare schemas for ms access, ms sql, and sometimes compare the schemas against each other. This application was written so that it would be simple to create a gui application to make use of it, but due to time constraints the gui was never finished, but is included in the project files.
This utility isn’t as “polished” (I use that term loosely) as my other utilities, but I think the target users should be able to handle it.
This application is currently tightly coupled to Ms sql server, Ms Access, and .net’s CLR types.
Some Notable code, is the datatype converter. using .GetSchema(“DataTypes”); from the database connection functions, it converts returns the string representation of the CLR type passed in
public static string dtConverter(string val, DataTable dtDataTypes)
if (int.TryParse(val, out outdtVal))
fieldName = "ProviderDbType";
if (outdtVal == 130) //access scheme does not define 130, looking at records it maps to string
dr = dtDataTypes.AsEnumerable().Where(i => i.Field<int>(fieldName) == outdtVal);
fieldName = "TypeName";
dr = dtDataTypes.AsEnumerable().Where(i => i.Field<string>(fieldName) == val);
if (dr.FirstOrDefault() == null)
Console.WriteLine("ERROR:" + fieldName + " " + val);