Programatically call extended stored procedure?

G

Guest

Hi,

C# / .NET Framework 1.1

I would like to query extended stored procedure like stored procedure...
However, I found that CommandType property does not have Extended Stored
Procedure value.....

I tried something like..

SqlConnection con = new SqlConnection(....);
SqlCommand command = new SqlCommand('xp_blahblahblah", con);
command.CommandType = CommandType.StoredProcedure;
......
....
command.ExecuteScalar();

However, it always throw exception saying "Could not find store procedure
xp_blahblahblah"....
Is there any way I can use the extended stored procedure programatically?

Thanks.

...................................................................TJ
 
S

Scott F.

Its been .. wow, 8 years since I've dealt with XPs, but if I remember
correctly, what you need to do is wrap your XP with a standard/normal
stored proc.

hth,
Scott "Cmdr. Beavis" F.
 
W

William \(Bill\) Vaughn

http://msdn.microsoft.com/library/d...nsqlmag01/html/ManagingExtendedProperties.asp
This shows you how--basically, put the ESP and parameters into the
CommandText preceded with EXEC


EXEC sp_addextendedproperty 'caption',
'Employee ID', 'user', dbo, 'table', T1, 'column', id
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 

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