SQL2005: DB-Owner cannot exec stored-proc that he himself created!

22/06/2006 - 14:37 por Meir S., ClearForsest | Informe spam
Hi all,

Following bug is backward-comatability issue with 2005 vs. 2000.

The script below runs perfectly on SQL2000, but fails on SQL2005.
Please note: I need to run it under an SQL-user, NOT a windows-login.
I grant this SQL-user a db_creator server-role.

What I do in this script is create a DB, create a stored-proc inside it,
and then try to run it.
Just to make things easier: If you uncomment the GRANT statement below, it
works fine.
Yet, on SQL2000 the GRANT was NOT required, PLUS:
The user is the db_owner, for crying-out-loud...
He should be able to run the proc he just created.


Again, let me stress this: When using Windows-Authentication user, the
script runs fine,
which seems also as an inconsistency in SQL2005.

So, is this a bug ?
Must I GRANT explicitly ?

Thanks
Meir
meir@clearforest.com



-

USE [master]
CREATE DATABASE kukuriku
Go
USE [kukuriku]

Go
CREATE PROCEDURE mySP1 AS
SELECT GetDate()
Go

Go

EXEC mySP1

Go
USE [master]
DROP DATABASE kukuriku
-
-
 

Leer las respuestas

#1 עמי לוין
22/06/2006 - 15:06 | Informe spam
Hi Meir,

I've tried your script on my machine and it runs fine.
the SQL Login that created the DB was automatically mapped to dbo user
Could you please give us a more detailed repro including the login creation?

HTH

עמי

* אם תשובתי הועילה לך, לחץ "כן" בשורה הכחולה בחלון משמאל ודרג הודעה זו.




"Meir S., ClearForsest":

Hi all,

Following bug is backward-comatability issue with 2005 vs. 2000.

The script below runs perfectly on SQL2000, but fails on SQL2005.
Please note: I need to run it under an SQL-user, NOT a windows-login.
I grant this SQL-user a db_creator server-role.

What I do in this script is create a DB, create a stored-proc inside it,
and then try to run it.
Just to make things easier: If you uncomment the GRANT statement below, it
works fine.
Yet, on SQL2000 the GRANT was NOT required, PLUS:
The user is the db_owner, for crying-out-loud...
He should be able to run the proc he just created.


Again, let me stress this: When using Windows-Authentication user, the
script runs fine,
which seems also as an inconsistency in SQL2005.

So, is this a bug ?
Must I GRANT explicitly ?

Thanks
Meir




-

USE [master]
CREATE DATABASE kukuriku
Go
USE [kukuriku]

Go
CREATE PROCEDURE mySP1 AS
SELECT GetDate()
Go

Go

EXEC mySP1

Go
USE [master]
DROP DATABASE kukuriku
-
-



Preguntas similares