SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Grant permission to create table in SP


Grant permission to create table in SP

Author
Message
atikdesai
atikdesai
SSC Rookie
SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)

Group: General Forum Members
Points: 27 Visits: 50
Hi everyone,
There is one user who has permission to execute one SP.
In that SP, one table is created in database and finally it is dropped at the end of the SP.
When this user is trying to run this SP he is getting following error.
"CREATE TABLE permission denied in database".

Please help me wth this.
Mr. Holio
Mr. Holio
SSC Eights!
SSC Eights! (935 reputation)SSC Eights! (935 reputation)SSC Eights! (935 reputation)SSC Eights! (935 reputation)SSC Eights! (935 reputation)SSC Eights! (935 reputation)SSC Eights! (935 reputation)SSC Eights! (935 reputation)

Group: General Forum Members
Points: 935 Visits: 2559
Is he member of the dbcreator server role?

updated 2/25/2011
damn, for some reason I read CREATE DATABASE ;-)

__________________________
Allzu viel ist ungesund...
Paul White
Paul White
SSCoach
SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)

Group: General Forum Members
Points: 15556 Visits: 11355
atikdesai (2/23/2011)
Hi everyone,
There is one user who has permission to execute one SP.
In that SP, one table is created in database and finally it is dropped at the end of the SP.
When this user is trying to run this SP he is getting following error.
"CREATE TABLE permission denied in database".

Please help me wth this.

You can sign the procedure with a certificate or key to grant CREATE TABLE within the procedure only, but why are you creating and dropping a 'real' table inside a procedure?



Paul White
SQLPerformance.com
SQLblog.com
@SQL_Kiwi
atikdesai
atikdesai
SSC Rookie
SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)

Group: General Forum Members
Points: 27 Visits: 50
SQLkiwi (2/24/2011)
atikdesai (2/23/2011)
Hi everyone,
There is one user who has permission to execute one SP.
In that SP, one table is created in database and finally it is dropped at the end of the SP.
When this user is trying to run this SP he is getting following error.
"CREATE TABLE permission denied in database".

Please help me wth this.

You can sign the procedure with a certificate or key to grant CREATE TABLE within the procedure only, but why are you creating and dropping a 'real' table inside a procedure?


Thanks for replying... Actually this SP has been developed by some other person and he left.
Please tell me how I can sign the procedure with a certificate or key to grant CREATE TABLE within the procedure only.
Paul White
Paul White
SSCoach
SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)

Group: General Forum Members
Points: 15556 Visits: 11355
atikdesai (2/24/2011)
Actually this SP has been developed by some other person and he left.

Well that sort of thing happens from time to time ;-)
You should still be able to understand what it is doing, and why it needs to create a real table. It seems unwise to modify something you don't understand yet.

Please tell me how I can sign the procedure with a certificate or key to grant CREATE TABLE within the procedure only.

There is a Microsoft tutorial here:
http://msdn.microsoft.com/en-us/library/bb283630.aspx

Paul



Paul White
SQLPerformance.com
SQLblog.com
@SQL_Kiwi
sturner
sturner
SSCrazy
SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)

Group: General Forum Members
Points: 2216 Visits: 3259
I would suggest that you create a temp table (in tempdb) for this as workaround.

You will still have the create table permission issue in tempdb but what have done is maintain an empty 'template' table in the current database, then create the temp table in tempdb via select into.

If you tempdb is tuned for good performance you usually be better off with your temp tables in there Vs in the current database.

The probability of survival is inversely proportional to the angle of arrival.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search