I am getting list of stored procedures from database by using SMO. I have foreach loop over stored procedures to make my intended operatioans on them. However I need to use only user created stored procedures. I use IsSystemObject attribute of stored procedures. However it is so much slow:
Approximately 10 sec:
foreach (StoredProcedure mystr in mydb.StoredProcedures)
{
if (!mystr.IsSystemObject)
{
classGenerated += mystr.Name + Environment.NewLine;
}
}
Less then 1 sec:
foreach (StoredProcedure mystr in mydb.StoredProcedures)
{
classGenerated += mystr.Name + Environment.NewLine;
}
Is this difference normal for only one if condition? If not, what is the cause of this performance difference? I can use another way to differentiate the system and non-system objects, if there is another method.