Пример #1
0
        private void _StageBulkIndexValues(IDatabaseService db, string objectFullName, ObjectMetadata metadata, IEnumerable<object[]> records)
        {
            var stagingTableName = _CreateStagingTableName(db, objectFullName);

            if (!_TableExists(db, stagingTableName))
            {
                _ProvisionIndexStaging(db, metadata);
            }

            var colNames = new List<string>();
            colNames.Add(db.MakeQuotedName(IDColumn));
            foreach (var idx in metadata.Indexes)
            {
                colNames.Add(db.MakeQuotedName(idx.Name));
            }

            db.ExecuteBulkInsert(
                records,
                "[ZeroG]." + db.MakeQuotedName(stagingTableName),
                colNames.ToArray());
        }