Hi all,
Is there a way to get an smo object (stored proc, UDF, etc...) from an items' name and a database object?
that is, without knowing what type of object xyz is, with the string "xyz" and a database object, can I get an smo object?
$object = $objSrcDB.EnumObjects() | ?{$_.Name -eq $objName} gives me a System.Data.DataRow.
If possible, I'd like to do it without getting into
if ($Object.DatabaseObjectTypes -eq "StoredProcedure") {...}
else if ($Object.DatabaseObjectTypes -eq "UDF") {...}
...
Thanks in advance,
P