Example #1
0
 public SqlObject(string parentName, string parentAlias, SqlObjectTypes type, string name)
 {
     ParentName  = parentName;
     ParentAlias = parentAlias;
     Type        = type;
     Name        = name;
 }
        public static List <string> ToTableTypes(this SqlObjectTypes sqlObjectTypes)
        {
            var list = new List <string>();

            if (sqlObjectTypes.HasFlag(SqlObjectTypes.Table))
            {
                list.Add(TableType.BaseTable);
            }

            if (sqlObjectTypes.HasFlag(SqlObjectTypes.View))
            {
                list.Add(TableType.View);
            }

            //if (sqlObjectTypes.HasFlag(SqlObjectTypes.Function))
            //{
            //    list.Add(SqlServerObjectType.ScalarFunction);
            //    list.Add(SqlServerObjectType.InlineTableValuedFunction);
            //    list.Add(SqlServerObjectType.TableValuedFunction);
            //}

            return(list);
        }
Example #3
0
    public static List <string> ToObjectTypes(this SqlObjectTypes sqlObjectTypes)
    {
        var list = new List <string>();

        if (sqlObjectTypes.HasFlag(SqlObjectTypes.Table))
        {
            list.Add(SqlServerObjectType.UserDefinedTable);
            list.Add(SqlServerObjectType.SystemTable);
        }

        if (sqlObjectTypes.HasFlag(SqlObjectTypes.View))
        {
            list.Add(SqlServerObjectType.View);
        }

        if (sqlObjectTypes.HasFlag(SqlObjectTypes.Function))
        {
            list.Add(SqlServerObjectType.ScalarFunction);
            list.Add(SqlServerObjectType.InlineTableValuedFunction);
            list.Add(SqlServerObjectType.TableValuedFunction);
        }

        return(list);
    }