Tuesday, March 27, 2012

create table riht on one specified table to one user

how can i give rights to the a user to create and drop one specified tableHi
I am not at all sure why you wish to do this! If the structure does not
change then you can just truncate the table, if you do have a variable
structure it will probably lead to a nightmare of dynamic code. You should
write a stored procedure to encapsulate this process.
John
"sunil" wrote:
> how can i give rights to the a user to create and drop one specified table
>
>|||You can do
GRANT CREATE TABLE TO username
Once the user has created the table, you can revoke above. Then user will now own the table and be
able to drop it. The user will not be able to specify some other user as owner, for that the
db_ddladmin role is needed (which is documented in Books Online what permissions comes with it).
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"sunil" <sunil@.discussions.microsoft.com> wrote in message
news:BE56743E-05C8-4054-BA21-F997B63A53BD@.microsoft.com...
> how can i give rights to the a user to create and drop one specified table
>
>|||Thanks for the reply but i don't know at wht time the user will create and
drop the table, In a store procedure he will create the table and in the end
the user drop the table so every time that store procedure runs the user
require the create right and drop table rihts but if i give him ddladmin then
he can create other table and drop other table also . So it is security risk,
hence i require that he user can create one specified table that is mention
in the stored procedure
"Tibor Karaszi" wrote:
> You can do
> GRANT CREATE TABLE TO username
> Once the user has created the table, you can revoke above. Then user will now own the table and be
> able to drop it. The user will not be able to specify some other user as owner, for that the
> db_ddladmin role is needed (which is documented in Books Online what permissions comes with it).
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "sunil" <sunil@.discussions.microsoft.com> wrote in message
> news:BE56743E-05C8-4054-BA21-F997B63A53BD@.microsoft.com...
> > how can i give rights to the a user to create and drop one specified table
> >
> >
> >
>|||Hi,
When u will create the table it will be created under that user and u
can use grant create table
but if u created the table under dbo user then everyone who has access
to that database will have access.
hoipe this help
from
Killer|||Hi
Use a temporary table if it only needed in the scope of the procedure.
John
"sunil" wrote:
> Thanks for the reply but i don't know at wht time the user will create and
> drop the table, In a store procedure he will create the table and in the end
> the user drop the table so every time that store procedure runs the user
> require the create right and drop table rihts but if i give him ddladmin then
> he can create other table and drop other table also . So it is security risk,
> hence i require that he user can create one specified table that is mention
> in the stored procedure
> "Tibor Karaszi" wrote:
> > You can do
> >
> > GRANT CREATE TABLE TO username
> >
> > Once the user has created the table, you can revoke above. Then user will now own the table and be
> > able to drop it. The user will not be able to specify some other user as owner, for that the
> > db_ddladmin role is needed (which is documented in Books Online what permissions comes with it).
> > --
> > Tibor Karaszi, SQL Server MVP
> > http://www.karaszi.com/sqlserver/default.asp
> > http://www.solidqualitylearning.com/
> > Blog: http://solidqualitylearning.com/blogs/tibor/
> >
> >
> > "sunil" <sunil@.discussions.microsoft.com> wrote in message
> > news:BE56743E-05C8-4054-BA21-F997B63A53BD@.microsoft.com...
> > > how can i give rights to the a user to create and drop one specified table
> > >
> > >
> > >
> >
> >

No comments:

Post a Comment