public string ColToSqlString(SColumn col, bool containidentity = true)
        {
            string templ = "{0} {1} {2} {3}";
            string s     = string.Format(templ, col.name, col.filedtype.ToSqlString(), col.allownull ? "null" : "not null",
                                         col.isidentity ? ("identity(" + col.identityattribute.send + "," + col.identityattribute.crement + ")") : ""
                                         );

            return(s);
        }
示例#2
0
        public string ColToSqlString(SColumn col, bool containidentity = true)
        {
            string templ = "{0} {1} {2} {3}  {4}";
            string s     = string.Format(templ, col.name, col.filedtype.ToSqlString(), col.allownull ? "null" : "not null",
                                         (containidentity && col.isidentity) ? ("AUTO_INCREMENT") : "",
                                         string.IsNullOrEmpty(col.description) ? "" : ("COMMENT '" + col.description.Replace("'", "\\'") + "' ")
                                         );

            return(s);
        }