コード例 #1
0
        public static void Main(string[] args)
        {
            if (args.Length != TotalNumberOfArgs)
            {
                Console.WriteLine("I got " + args.Length + " arguments to this process. I need " + TotalNumberOfArgs);
                for (var i = 0; i < args.Length; i++)
                {
                    Console.WriteLine("Arg : " + i + " is : " + args[i]);
                }
                Console.WriteLine("Usage:");
                Console.WriteLine("GeneratorTool <importName> <generatedScriptPath> <sourceConnectionString> <destinationConnectionString> <stagingDatabaseConnectionString> <importSchemaName> <defaultImportRunId> <defaultSourceIds> <logFileDir>");
                return;
            }

            var importName                      = args[0];
            var generatedScriptPath             = args[1];
            var sourceConnectionString          = args[2];
            var destinationConnectionString     = args[3];
            var stagingDatabaseConnectionString = args[4];
            var importSchemaName                = args[5];
            var defaultImportRunId              = Convert.ToInt64(args[6]);
            var defaultSourceIds                = args[7];
            var logFileDir                      = args[8];

            Console.WriteLine("ctor for SsisPackageGenerator about to be called");

            var session = CreateSession(stagingDatabaseConnectionString);
            var importSchemaRepository = new ImportSchemaRepository(session, importName);
            var ssisPackageGenerator   = new SsisPackageGenerator(importSchemaRepository, importName, generatedScriptPath, sourceConnectionString,
                                                                  destinationConnectionString,
                                                                  stagingDatabaseConnectionString, importSchemaName,
                                                                  defaultImportRunId, defaultSourceIds, logFileDir);

            ssisPackageGenerator.GeneratePackage();
        }
コード例 #2
0
        public static void Main(string[] args)
        {
            if (args.Length != TotalNumberOfArgs)
            {
                Console.WriteLine("I got " + args.Length + " arguments to this process. I need " + TotalNumberOfArgs);
                for (var i = 0; i < args.Length; i++)
                {
                    Console.WriteLine("Arg : " + i + " is : " + args[i]);
                }
                Console.WriteLine("Usage:");
                Console.WriteLine("GeneratorTool <importName> <generatedScriptPath> <sourceConnectionString> <destinationConnectionString> <stagingDatabaseConnectionString> <importSchemaName> <defaultImportRunId> <defaultSourceIds> <logFileDir>");
                return;
            }

            var importName = args[0];
            var generatedScriptPath = args[1];
            var sourceConnectionString = args[2];
            var destinationConnectionString = args[3];
            var stagingDatabaseConnectionString = args[4];
            var importSchemaName = args[5];
            var defaultImportRunId = Convert.ToInt64(args[6]);
            var defaultSourceIds = args[7];
            var logFileDir = args[8];
            Console.WriteLine("ctor for SsisPackageGenerator about to be called");

            var session = CreateSession(stagingDatabaseConnectionString);
            var importSchemaRepository = new ImportSchemaRepository(session,importName);
            var ssisPackageGenerator = new SsisPackageGenerator(importSchemaRepository,importName, generatedScriptPath, sourceConnectionString,
                                                                destinationConnectionString,
                                                                stagingDatabaseConnectionString, importSchemaName,
                                                                defaultImportRunId, defaultSourceIds, logFileDir);
            ssisPackageGenerator.GeneratePackage();
        }