示例#1
0
        public static string CreateSqlScript(this TransformDescriptor descriptor, out string fieldsPattern)
        {
            fieldsPattern = string.Empty;
            if (descriptor.Fields != null && descriptor.Fields.Any())
            {
                fieldsPattern = string.Join(", ", descriptor.Fields);
            }
            else
            {
                fieldsPattern = "*";
            }

            return(string.Format("SELECT {0} FROM {1}", fieldsPattern, descriptor.SqlTableNameDialect()));
        }
示例#2
0
 public static string CreateCountScript(this TransformDescriptor descriptor)
 {
     return(string.Format("SELECT COUNT(*) FROM {0} WHERE {1} > 0", descriptor.SqlTableNameDialect(), descriptor.IdentityColumnName));
 }