Stored Procedure Defination from C#

D

DIA

Can we find the defination of a SQL stored procedure
using c#?

1. Using SQL-DMO in c# I was able to locate a SQL server
in the network.
2. Hit the target database in the selected server.
3. Get object of SQLDMO._StoredProcedure class point to
the stored procedures which i need to refer.

I am stuck at findding the parameters and their for the
particular stored procedure.

Can come body help me on this
 
N

Nick Malik

I have not tried to do this in C#.
In general, to get the info you are looking for:

use SQLDMO to select the database.
Use the StoredProcedures object to enumerate the stored procs. Find the
proc that you are looking for in this collection.
Once found, use the EnumParameters method on the selected StoredProcedure
object to get the list of parameters.

return type is QueryResults.

See:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqldmo/dmoref_m_e2_5bc4.asp

HTH,
--- Nick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top