Home All Groups Group Topic Archive Search About
Author
14 Mar 2006 6:44 PM
Lee
Using SMO for .NET 2.0 how can I determine...
If a stored procedure's parameter is Input only, or input/output?

Author
14 Mar 2006 10:33 PM
Jasper Smith
You can use the IsOutputParameter property of the StoredProcedureParameter
object e.g.

Server svr = new Server();
StoredProcedure p =
svr.Databases["master"].StoredProcedures["sp_dbcmptlevel", "dbo"];

foreach (StoredProcedureParameter sp in p.Parameters)
{
    Console.WriteLine(sp.Name + "," +
                      sp.DataType.ToString() + "," +
                      (sp.IsOutputParameter ? "Input/Output" : "Input"));
}

--
HTH,
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com


Show quote
"Lee" <L**@discussions.microsoft.com> wrote in message
news:7977CBBF-A908-43B7-81F6-2DF84D53030A@microsoft.com...
> Using SMO for .NET 2.0 how can I determine...
> If a stored procedure's parameter is Input only, or input/output?

AddThis Social Bookmark Button