Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            runScript();
            split();
            var switches = new ConsoleSwitches(args);

            Console.WriteLine("Starting...");
            Exec(switches);
            Console.WriteLine("Completed");
        }
Ejemplo n.º 2
0
        private static void Exec(ConsoleSwitches switches)
        {
            var schema      = string.Empty;//switches["/schema"];
            var table       = switches["/table"];
            var source      = switches["/source"];
            var destination = switches["/destination"];
            var content     = File.ReadAllText(source);
            var options     = new Options()
            {
                Schema = schema, TableName = table, Separator = ",", FirstRowIsHeader = true
            };
            var data    = (new Parser(content, options)).ToData();
            var sqlText = (new SqlServerConverter(data, options)).ToString();

            File.WriteAllText(destination, sqlText);
        }