Ejemplo n.º 1
0
        public static bool FilterTypes(Urn urn)
        {
            if (urn.Type == "UserDefinedDataType")
            {
                TraceService.Debug("Filtered UserDefinedDataType");
                return(true);
            }

            if (urn.Type == "XmlSchemaCollection")
            {
                TraceService.Debug("Filtered XmlSchemaCollection");
                return(true);
            }

            if (urn.Type == "StoredProcedure")
            {
                TraceService.Debug("Filtered StoredProcedure");
                return(true);
            }

            if (urn.Type == "UnresolvedEntity")
            {
                TraceService.Debug("Filtered UnresolvedEntity");
                return(true);
            }

            return(false);
        }
Ejemplo n.º 2
0
        private List <Urn> GetGenericUrns(SmoCollectionBase collections)
        {
            var urns = new List <Urn>();

            foreach (SqlSmoObject smo in collections)
            {
                //skip all system objects
                if (smo is Schema && ((smo as Schema).IsSystemObject))
                {
                    continue;
                }
                if (smo is Table && ((smo as Table).IsSystemObject))
                {
                    continue;
                }
                if (smo is View && ((smo as View).IsSystemObject))
                {
                    continue;
                }
                if (smo is StoredProcedure && ((smo as StoredProcedure).IsSystemObject))
                {
                    continue;
                }
                if (smo is UserDefinedFunction && ((smo as UserDefinedFunction).IsSystemObject))
                {
                    continue;
                }

                TraceService.Debug($"Listed urn for scripting: {smo.Urn}");
                urns.Add(smo.Urn);
            }
            return(urns);
        }