Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EXECUTE privilege not compatible with a object,

Status
Not open for further replies.

Phoenix130481

Programmer
Aug 23, 2004
8
0
0
DE
Hello,

as you can see above i get this message when i want to start a stored procedure. i have grant the execute right to the stored procedure but i get then this error. below you can see the full error message:

ystem.Data.SqlClient.SqlException: Das erteilte oder aufgehobene EXECUTE-Privileg ist mit dem Objekt nicht kompatibel.
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at OPAprojekt.DatabaseConnection.ExecuteStoredProcedure(StoredProcedureBasisKlasse storedProcedure, SqlTransaction transaction) in e:\inetpub\ 107
at OPAprojekt.DatabaseConnection.ExecuteNonQuery(StoredProcedureBasisKlasse storedProcedure) in e:\inetpub\ 96
at OPAprojekt.WebForm2.Button2_Click(Object sender, EventArgs e) in e:\inetpub\ 134

does anyone has a idea waht that might be? i think it sounds like a programming error...

i am thankful for every idea!

basti
 
Does your stored procedure have dynamic SQL? IF so granting execute on the SP itself is not enough, you muidt grant rights to the tables/views used.

If not, are you sure that the user executing this is the user you thought would be executing it?

Questions about posting. See faq183-874
 
You need to grant the execute privelege to the user running the sp.

Bastien

Cat, the other other white meat
 
This is what i wrote!
StoredProceduresInsertStudenten is the SP,
OpaDBUser is the User,
UserMM is the Table i want to insert the Data

Grant Execute On StoredProceduresInsertStudenten To OpaDBUser
Grant SELECT, INSERT, DELETE, UPDATE, REFERENCES on UserMM To OpaDBUser

amd below you can see the storedProcedure!


ALTER PROCEDURE StoredProceduresInsertStudenten
@Vorname CHAR(100)
AS
BEGIN
INSERT INTO UserMM
(
V_Name
)
VALUES
(
@Vorname
)
END

GRANT EXEC ON UserMM TO OpaDBUser

I hope somebody can help me!!

Basti
 
What happens if you run this query outside a stored procedure with the variable hard-coded? Does it insert? Do you get an error message?

Questions about posting. See faq183-874
 
This is strange, when i use the server explorer in Visual Studio it does work...so i guess it must be a programming error somewhere inside my program.

SQLBrother ;)
 
Hello,

i could solve the problem! the problem was GRANT EXEC ON UserMM TO OpaDBUser!! UserMM is the Table, OpaDB the user...very strange!! does anyone has a explanation for this?!

Basti
 
I didn;t even know you could grant exec on a table.

Questions about posting. See faq183-874
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top