June 15, 2016 at 11:44 am
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
June 16, 2016 at 7:07 am
Got it:
$object = $objSrcDB.Discover() | ?{$_.Name -eq $objName}
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy