SqlCommandBuilder.DeriveParameters Permissions

  • Thread starter Thread starter Mike S.
  • Start date Start date
M

Mike S.

hello,

i'm trying to populate the ParametersCollection of a SqlCommand throug the
static method DeriveParameters of the SqlCommandBuilder class
everything works fine when using the sa login of the database - but when i
try to use a login which only have permissions to "Execute" the stored
procedure the method only returns the ReturnValue of the stored procedure as
Parameter. i've also tried to grant the permission "View Definition" but
with no success

any ideas or advices?
regards, mike s.
 
hi miha,
the code should be used in a very generic webservice which calls a lot of
stored procedures - it would be nice not to change the webservice each time
if one of stored procedure parameters change

regards,
mike

Miha Markic said:
Hi Mike,

Why don't you rather create the stuff at design time?

--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

Mike S. said:
hello,

i'm trying to populate the ParametersCollection of a SqlCommand throug
the static method DeriveParameters of the SqlCommandBuilder class
everything works fine when using the sa login of the database - but when
i try to use a login which only have permissions to "Execute" the stored
procedure the method only returns the ReturnValue of the stored procedure
as Parameter. i've also tried to grant the permission "View Definition"
but with no success

any ideas or advices?
regards, mike s.
 
Mike S. said:
hi miha,
the code should be used in a very generic webservice which calls a lot of
stored procedures - it would be nice not to change the webservice each
time if one of stored procedure parameters change

But if the parameters change, shouldn't the calling code know about the
change?
I mean you need to modfiy code, also or not?
 
hi again,
the idea is to pass a generic xml document to the web service which contains
all parameters and their values needed to call the stored procedure in the
database - so if we had to make changes only the client code which calls the
webservice and the server code in the stored procedure need to be updated,
but not the code in the webservice

thanks for your interest
mike s.
 
Why don't you construct parameters out of xml then?
You don't need to populate them before...
 
Back
Top