We need to revoke all insert/update/delete access from public. So this won't
affect users I wanted to create a new role and grant it all of these excess
permissions from public, then revoke the permissions from public. It looks
like there are thousands of grants that need to be revoked - can anyone thin
k
of a way to script this?
Thank you in advance.One method is to generate the script using Transact-SQL. You can tweak the
example below to generate the desired script. This example script ignores
system objects and doesn't handle column permissions.
SET NOCOUNT ON
SELECT
CASE [p].[protecttype]
WHEN 204 THEN 'GRANT '
WHEN 205 THEN 'GRANT '
WHEN 206 THEN 'DENY '
END +
CASE [p].[action]
WHEN 193 THEN 'SELECT'
WHEN 195 THEN 'INSERT'
WHEN 196 THEN 'DELETE'
WHEN 197 THEN 'UPDATE'
WHEN 224 THEN 'EXECUTE'
WHEN 26 THEN 'REFERENCES'
END + ' ON ' +
QUOTENAME(USER_NAME([o].[uid])) + '.' +
QUOTENAME([o].[name]) + ' TO ' +
QUOTENAME([u].[name]) +
CASE WHEN [p].[protecttype] = 204 THEN ' WITH GRANT OPTION' ELSE '' END
FROM
[sysobjects] AS [o]
JOIN
[sysprotects] AS [p] ON
[p].[id] = [o].[id]
JOIN
[sysusers] AS [u] ON
[p].[uid] = [u].[uid]
WHERE
OBJECTPROPERTY([o].[id], 'IsMSShipped') = 0 AND
[u].[name] = 'public'
Hope this helps.
Dan Guzman
SQL Server MVP
"Bobsie" <Bobsie@.discussions.microsoft.com> wrote in message
news:745289F7-F2CF-4079-8A35-66974CFA73F3@.microsoft.com...
> We need to revoke all insert/update/delete access from public. So this
> won't
> affect users I wanted to create a new role and grant it all of these
> excess
> permissions from public, then revoke the permissions from public. It looks
> like there are thousands of grants that need to be revoked - can anyone
> think
> of a way to script this?
> Thank you in advance.|||Thanks for the help - and when it comes to revoking the permissions from
"public" I could use a similar script using "revoke" instead of "grant"?
"Dan Guzman" wrote:
> One method is to generate the script using Transact-SQL. You can tweak th
e
> example below to generate the desired script. This example script ignores
> system objects and doesn't handle column permissions.
> SET NOCOUNT ON
> SELECT
> CASE [p].[protecttype]
> WHEN 204 THEN 'GRANT '
> WHEN 205 THEN 'GRANT '
> WHEN 206 THEN 'DENY '
> END +
> CASE [p].[action]
> WHEN 193 THEN 'SELECT'
> WHEN 195 THEN 'INSERT'
> WHEN 196 THEN 'DELETE'
> WHEN 197 THEN 'UPDATE'
> WHEN 224 THEN 'EXECUTE'
> WHEN 26 THEN 'REFERENCES'
> END + ' ON ' +
> QUOTENAME(USER_NAME([o].[uid])) + '.' +
> QUOTENAME([o].[name]) + ' TO ' +
> QUOTENAME([u].[name]) +
> CASE WHEN [p].[protecttype] = 204 THEN ' WITH GRANT OPTION' ELSE '' END
> FROM
> [sysobjects] AS [o]
> JOIN
> [sysprotects] AS [p] ON
> [p].[id] = [o].[id]
> JOIN
> [sysusers] AS [u] ON
> [p].[uid] = [u].[uid]
> WHERE
> OBJECTPROPERTY([o].[id], 'IsMSShipped') = 0 AND
> [u].[name] = 'public'
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Bobsie" <Bobsie@.discussions.microsoft.com> wrote in message
> news:745289F7-F2CF-4079-8A35-66974CFA73F3@.microsoft.com...
>
>|||Yes, Bobsie, the script I posted was developed to script existing
permissions. You'll need to modify it so that modified permission scripts
are generated instead.
Run the script once to extract the public permissions with your new role
hard-coded as the grantee instead of public'. The generated script will
looks something like:
GRANT SELECT ON MyTable TO MyNewRole
GRANT EXECUTE ON MyProc TO MyNewRole
Then run the script again with a hard-coded REVOKE instead of the GRANT/DENY
CASE statement so the second script generated will be like:
REVOKE SELECT ON MyTable TO public
REVOKE EXECUTE ON MyProc TO public
Be sure to review the generated scripts before running in your environment.
Hope this helps.
Dan Guzman
SQL Server MVP
"Bobsie" <Bobsie@.discussions.microsoft.com> wrote in message
news:3949EB00-7D35-4EC1-9920-249ABF69BBEC@.microsoft.com...
> Thanks for the help - and when it comes to revoking the permissions from
> "public" I could use a similar script using "revoke" instead of "grant"?
>
> "Dan Guzman" wrote:
>sql
Showing posts with label public. Show all posts
Showing posts with label public. Show all posts
Thursday, March 29, 2012
Tuesday, March 27, 2012
grant select to public
I'm NOT the dbo
but I am allowed to create table/views/UDF
But I can't not do this:
grant select on vw_I_created to public
got this error:
SQL Server Database Error: Grantor does not have GRANT permission.
Is this right ?Your user was not given GRANT permission, which is the ability to grant a
specified permission to other principals.
"klabu" wrote:
> I'm NOT the dbo
> but I am allowed to create table/views/UDF
> But I can't not do this:
> grant select on vw_I_created to public
> got this error:
> SQL Server Database Error: Grantor does not have GRANT permission.
> Is this right ?
>
>|||Hi,
On specific objects if you have to give grant again to other securiy
accounts you can use or ask the admin for the grant with below option
WITH GRANT OPTION
Thanks
Ajay
"Edgardo Valdez, MCTS / MCITP"
<EdgardoValdezMCTSMCITP@.discussions.microsoft.com> wrote in message
news:B7485BF1-0937-4FE6-97A0-A4486985F37B@.microsoft.com...
> Your user was not given GRANT permission, which is the ability to grant a
> specified permission to other principals.
> "klabu" wrote:
>> I'm NOT the dbo
>> but I am allowed to create table/views/UDF
>> But I can't not do this:
>> grant select on vw_I_created to public
>> got this error:
>> SQL Server Database Error: Grantor does not have GRANT permission.
>> Is this right ?
>>
but I am allowed to create table/views/UDF
But I can't not do this:
grant select on vw_I_created to public
got this error:
SQL Server Database Error: Grantor does not have GRANT permission.
Is this right ?Your user was not given GRANT permission, which is the ability to grant a
specified permission to other principals.
"klabu" wrote:
> I'm NOT the dbo
> but I am allowed to create table/views/UDF
> But I can't not do this:
> grant select on vw_I_created to public
> got this error:
> SQL Server Database Error: Grantor does not have GRANT permission.
> Is this right ?
>
>|||Hi,
On specific objects if you have to give grant again to other securiy
accounts you can use or ask the admin for the grant with below option
WITH GRANT OPTION
Thanks
Ajay
"Edgardo Valdez, MCTS / MCITP"
<EdgardoValdezMCTSMCITP@.discussions.microsoft.com> wrote in message
news:B7485BF1-0937-4FE6-97A0-A4486985F37B@.microsoft.com...
> Your user was not given GRANT permission, which is the ability to grant a
> specified permission to other principals.
> "klabu" wrote:
>> I'm NOT the dbo
>> but I am allowed to create table/views/UDF
>> But I can't not do this:
>> grant select on vw_I_created to public
>> got this error:
>> SQL Server Database Error: Grantor does not have GRANT permission.
>> Is this right ?
>>
grant select to public
I'm NOT the dbo
but I am allowed to create table/views/UDF
But I can't not do this:
grant select on vw_I_created to public
got this error:
SQL Server Database Error: Grantor does not have GRANT permission.
Is this right ?
Your user was not given GRANT permission, which is the ability to grant a
specified permission to other principals.
"klabu" wrote:
> I'm NOT the dbo
> but I am allowed to create table/views/UDF
> But I can't not do this:
> grant select on vw_I_created to public
> got this error:
> SQL Server Database Error: Grantor does not have GRANT permission.
> Is this right ?
>
>
|||Hi,
On specific objects if you have to give grant again to other securiy
accounts you can use or ask the admin for the grant with below option
WITH GRANT OPTION
Thanks
Ajay
"Edgardo Valdez, MCTS / MCITP"
<EdgardoValdezMCTSMCITP@.discussions.microsoft.com> wrote in message
news:B7485BF1-0937-4FE6-97A0-A4486985F37B@.microsoft.com...[vbcol=seagreen]
> Your user was not given GRANT permission, which is the ability to grant a
> specified permission to other principals.
> "klabu" wrote:
but I am allowed to create table/views/UDF
But I can't not do this:
grant select on vw_I_created to public
got this error:
SQL Server Database Error: Grantor does not have GRANT permission.
Is this right ?
Your user was not given GRANT permission, which is the ability to grant a
specified permission to other principals.
"klabu" wrote:
> I'm NOT the dbo
> but I am allowed to create table/views/UDF
> But I can't not do this:
> grant select on vw_I_created to public
> got this error:
> SQL Server Database Error: Grantor does not have GRANT permission.
> Is this right ?
>
>
|||Hi,
On specific objects if you have to give grant again to other securiy
accounts you can use or ask the admin for the grant with below option
WITH GRANT OPTION
Thanks
Ajay
"Edgardo Valdez, MCTS / MCITP"
<EdgardoValdezMCTSMCITP@.discussions.microsoft.com> wrote in message
news:B7485BF1-0937-4FE6-97A0-A4486985F37B@.microsoft.com...[vbcol=seagreen]
> Your user was not given GRANT permission, which is the ability to grant a
> specified permission to other principals.
> "klabu" wrote:
grant select to public
I'm NOT the dbo
but I am allowed to create table/views/UDF
But I can't not do this:
grant select on vw_I_created to public
got this error:
SQL Server Database Error: Grantor does not have GRANT permission.
Is this right ?Your user was not given GRANT permission, which is the ability to grant a
specified permission to other principals.
"klabu" wrote:
> I'm NOT the dbo
> but I am allowed to create table/views/UDF
> But I can't not do this:
> grant select on vw_I_created to public
> got this error:
> SQL Server Database Error: Grantor does not have GRANT permission.
> Is this right ?
>
>|||Hi,
On specific objects if you have to give grant again to other securiy
accounts you can use or ask the admin for the grant with below option
WITH GRANT OPTION
Thanks
Ajay
"Edgardo Valdez, MCTS / MCITP"
<EdgardoValdezMCTSMCITP@.discussions.microsoft.com> wrote in message
news:B7485BF1-0937-4FE6-97A0-A4486985F37B@.microsoft.com...[vbcol=seagreen]
> Your user was not given GRANT permission, which is the ability to grant a
> specified permission to other principals.
> "klabu" wrote:
>sql
but I am allowed to create table/views/UDF
But I can't not do this:
grant select on vw_I_created to public
got this error:
SQL Server Database Error: Grantor does not have GRANT permission.
Is this right ?Your user was not given GRANT permission, which is the ability to grant a
specified permission to other principals.
"klabu" wrote:
> I'm NOT the dbo
> but I am allowed to create table/views/UDF
> But I can't not do this:
> grant select on vw_I_created to public
> got this error:
> SQL Server Database Error: Grantor does not have GRANT permission.
> Is this right ?
>
>|||Hi,
On specific objects if you have to give grant again to other securiy
accounts you can use or ask the admin for the grant with below option
WITH GRANT OPTION
Thanks
Ajay
"Edgardo Valdez, MCTS / MCITP"
<EdgardoValdezMCTSMCITP@.discussions.microsoft.com> wrote in message
news:B7485BF1-0937-4FE6-97A0-A4486985F37B@.microsoft.com...[vbcol=seagreen]
> Your user was not given GRANT permission, which is the ability to grant a
> specified permission to other principals.
> "klabu" wrote:
>sql
'GRANT SELECT ON sysprocesses TO PUBLIC' does not work in SQL 2005
'GRANT SELECT ON sysprocesses TO PUBLIC'
This statement used to work in SQL 7.0 and 2000.
But due to changes in security in SQL 2005 I receive
Server: Msg 4610, Level 16, State 1, Line 1
You can only grant or revoke permissions on objects in the current database.
I am currently on master DB. So I do not understand the error message.
'sysproceses' is a sytem view, in the sys schema.
Objects created in SQL 2005 belong to schemas.
In SQL 2000, sysprocesses is a system table ans objects belong to owner.
Any idea?
Best regards
AlexCT
You should post this in the 2005 beta newsgroups
Bert
This statement used to work in SQL 7.0 and 2000.
But due to changes in security in SQL 2005 I receive
Server: Msg 4610, Level 16, State 1, Line 1
You can only grant or revoke permissions on objects in the current database.
I am currently on master DB. So I do not understand the error message.
'sysproceses' is a sytem view, in the sys schema.
Objects created in SQL 2005 belong to schemas.
In SQL 2000, sysprocesses is a system table ans objects belong to owner.
Any idea?
Best regards
AlexCT
You should post this in the 2005 beta newsgroups
Bert
'GRANT SELECT ON sysprocesses TO PUBLIC' does not work in SQL 2005
'GRANT SELECT ON sysprocesses TO PUBLIC'
This statement used to work in SQL 7.0 and 2000.
But due to changes in security in SQL 2005 I receive
Server: Msg 4610, Level 16, State 1, Line 1
You can only grant or revoke permissions on objects in the current database.
I am currently on master DB. So I do not understand the error message.
'sysproceses' is a sytem view, in the sys schema.
Objects created in SQL 2005 belong to schemas.
In SQL 2000, sysprocesses is a system table ans objects belong to owner.
Any idea?
Best regards
AlexCTYou should post this in the 2005 beta newsgroups
Bert
This statement used to work in SQL 7.0 and 2000.
But due to changes in security in SQL 2005 I receive
Server: Msg 4610, Level 16, State 1, Line 1
You can only grant or revoke permissions on objects in the current database.
I am currently on master DB. So I do not understand the error message.
'sysproceses' is a sytem view, in the sys schema.
Objects created in SQL 2005 belong to schemas.
In SQL 2000, sysprocesses is a system table ans objects belong to owner.
Any idea?
Best regards
AlexCTYou should post this in the 2005 beta newsgroups
Bert
'GRANT SELECT ON sysprocesses TO PUBLIC' does not work in SQL 2005
'GRANT SELECT ON sysprocesses TO PUBLIC'
This statement used to work in SQL 7.0 and 2000.
But due to changes in security in SQL 2005 I receive
Server: Msg 4610, Level 16, State 1, Line 1
You can only grant or revoke permissions on objects in the current database.
I am currently on master DB. So I do not understand the error message.
'sysproceses' is a sytem view, in the sys schema.
Objects created in SQL 2005 belong to schemas.
In SQL 2000, sysprocesses is a system table ans objects belong to owner.
Any idea?
Best regards
AlexCTYou should post this in the 2005 beta newsgroups
Bert
This statement used to work in SQL 7.0 and 2000.
But due to changes in security in SQL 2005 I receive
Server: Msg 4610, Level 16, State 1, Line 1
You can only grant or revoke permissions on objects in the current database.
I am currently on master DB. So I do not understand the error message.
'sysproceses' is a sytem view, in the sys schema.
Objects created in SQL 2005 belong to schemas.
In SQL 2000, sysprocesses is a system table ans objects belong to owner.
Any idea?
Best regards
AlexCTYou should post this in the 2005 beta newsgroups
Bert
Monday, March 26, 2012
Grant Permission
I have one doubt.
I have created one user "Testuser" and it is asssined to public role.
The created user does not have create table permission by default. What
i did was i have granted create table permission to "Testuser" from my
sa login. I have created one table called "permission_test" using
"Testuser". Now "Testuser" become the owner of this table.
i have tried access the table from the Testuser. I can do it.
Now the problem is that if i have tried access the table from my sa
login. i.e
select * from "permission_test" I got the error saying that "Invalid
object name 'permission_test'"
Then i have executed the follwing statment from my testuser
grant select on permission_test to dbo
after this i am getting follwing errors "Invalid object name
'permission_test'"
What should i do to avoid this problem?
My doubt is that,if the owner is different from the DBO, then DBO could
not have any acess to other owners objects?
RegardsUse the 4-part name server.db.owner.object
joe.
"Praveen" <apveen@.gmail.com> wrote in message
news:1127306421.920830.60330@.g14g2000cwa.googlegroups.com...
>I have one doubt.
> I have created one user "Testuser" and it is asssined to public role.
> The created user does not have create table permission by default. What
> i did was i have granted create table permission to "Testuser" from my
> sa login. I have created one table called "permission_test" using
> "Testuser". Now "Testuser" become the owner of this table.
>
> i have tried access the table from the Testuser. I can do it.
>
> Now the problem is that if i have tried access the table from my sa
> login. i.e
> select * from "permission_test" I got the error saying that "Invalid
> object name 'permission_test'"
>
> Then i have executed the follwing statment from my testuser
>
> grant select on permission_test to dbo
>
> after this i am getting follwing errors "Invalid object name
> 'permission_test'"
>
> What should i do to avoid this problem?
>
> My doubt is that,if the owner is different from the DBO, then DBO could
> not have any acess to other owners objects?
>
> Regards
>
I have created one user "Testuser" and it is asssined to public role.
The created user does not have create table permission by default. What
i did was i have granted create table permission to "Testuser" from my
sa login. I have created one table called "permission_test" using
"Testuser". Now "Testuser" become the owner of this table.
i have tried access the table from the Testuser. I can do it.
Now the problem is that if i have tried access the table from my sa
login. i.e
select * from "permission_test" I got the error saying that "Invalid
object name 'permission_test'"
Then i have executed the follwing statment from my testuser
grant select on permission_test to dbo
after this i am getting follwing errors "Invalid object name
'permission_test'"
What should i do to avoid this problem?
My doubt is that,if the owner is different from the DBO, then DBO could
not have any acess to other owners objects?
RegardsUse the 4-part name server.db.owner.object
joe.
"Praveen" <apveen@.gmail.com> wrote in message
news:1127306421.920830.60330@.g14g2000cwa.googlegroups.com...
>I have one doubt.
> I have created one user "Testuser" and it is asssined to public role.
> The created user does not have create table permission by default. What
> i did was i have granted create table permission to "Testuser" from my
> sa login. I have created one table called "permission_test" using
> "Testuser". Now "Testuser" become the owner of this table.
>
> i have tried access the table from the Testuser. I can do it.
>
> Now the problem is that if i have tried access the table from my sa
> login. i.e
> select * from "permission_test" I got the error saying that "Invalid
> object name 'permission_test'"
>
> Then i have executed the follwing statment from my testuser
>
> grant select on permission_test to dbo
>
> after this i am getting follwing errors "Invalid object name
> 'permission_test'"
>
> What should i do to avoid this problem?
>
> My doubt is that,if the owner is different from the DBO, then DBO could
> not have any acess to other owners objects?
>
> Regards
>
Grant Permission
I have one doubt.
I have created one user "Testuser" and it is asssined to public role.
The created user does not have create table permission by default. What
i did was i have granted create table permission to "Testuser" from my
sa login. I have created one table called "permission_test" using
"Testuser". Now "Testuser" become the owner of this table.
i have tried access the table from the Testuser. I can do it.
Now the problem is that if i have tried access the table from my sa
login. i.e
select * from "permission_test" I got the error saying that "Invalid
object name 'permission_test'"
Then i have executed the follwing statment from my testuser
grant select on permission_test to dbo
after this i am getting follwing errors "Invalid object name
'permission_test'"
What should i do to avoid this problem?
My doubt is that,if the owner is different from the DBO, then DBO could
not have any acess to other owners objects?
Regards
Use the 4-part name server.db.owner.object
joe.
"Praveen" <apveen@.gmail.com> wrote in message
news:1127306421.920830.60330@.g14g2000cwa.googlegro ups.com...
>I have one doubt.
> I have created one user "Testuser" and it is asssined to public role.
> The created user does not have create table permission by default. What
> i did was i have granted create table permission to "Testuser" from my
> sa login. I have created one table called "permission_test" using
> "Testuser". Now "Testuser" become the owner of this table.
>
> i have tried access the table from the Testuser. I can do it.
>
> Now the problem is that if i have tried access the table from my sa
> login. i.e
> select * from "permission_test" I got the error saying that "Invalid
> object name 'permission_test'"
>
> Then i have executed the follwing statment from my testuser
>
> grant select on permission_test to dbo
>
> after this i am getting follwing errors "Invalid object name
> 'permission_test'"
>
> What should i do to avoid this problem?
>
> My doubt is that,if the owner is different from the DBO, then DBO could
> not have any acess to other owners objects?
>
> Regards
>
sql
I have created one user "Testuser" and it is asssined to public role.
The created user does not have create table permission by default. What
i did was i have granted create table permission to "Testuser" from my
sa login. I have created one table called "permission_test" using
"Testuser". Now "Testuser" become the owner of this table.
i have tried access the table from the Testuser. I can do it.
Now the problem is that if i have tried access the table from my sa
login. i.e
select * from "permission_test" I got the error saying that "Invalid
object name 'permission_test'"
Then i have executed the follwing statment from my testuser
grant select on permission_test to dbo
after this i am getting follwing errors "Invalid object name
'permission_test'"
What should i do to avoid this problem?
My doubt is that,if the owner is different from the DBO, then DBO could
not have any acess to other owners objects?
Regards
Use the 4-part name server.db.owner.object
joe.
"Praveen" <apveen@.gmail.com> wrote in message
news:1127306421.920830.60330@.g14g2000cwa.googlegro ups.com...
>I have one doubt.
> I have created one user "Testuser" and it is asssined to public role.
> The created user does not have create table permission by default. What
> i did was i have granted create table permission to "Testuser" from my
> sa login. I have created one table called "permission_test" using
> "Testuser". Now "Testuser" become the owner of this table.
>
> i have tried access the table from the Testuser. I can do it.
>
> Now the problem is that if i have tried access the table from my sa
> login. i.e
> select * from "permission_test" I got the error saying that "Invalid
> object name 'permission_test'"
>
> Then i have executed the follwing statment from my testuser
>
> grant select on permission_test to dbo
>
> after this i am getting follwing errors "Invalid object name
> 'permission_test'"
>
> What should i do to avoid this problem?
>
> My doubt is that,if the owner is different from the DBO, then DBO could
> not have any acess to other owners objects?
>
> Regards
>
sql
Grant Permission
I have one doubt.
I have created one user "Testuser" and it is asssined to public role.
The created user does not have create table permission by default. What
i did was i have granted create table permission to "Testuser" from my
sa login. I have created one table called "permission_test" using
"Testuser". Now "Testuser" become the owner of this table.
i have tried access the table from the Testuser. I can do it.
Now the problem is that if i have tried access the table from my sa
login. i.e
select * from "permission_test" I got the error saying that "Invalid
object name 'permission_test'"
Then i have executed the follwing statment from my testuser
grant select on permission_test to dbo
after this i am getting follwing errors "Invalid object name
'permission_test'"
What should i do to avoid this problem?
My doubt is that,if the owner is different from the DBO, then DBO could
not have any acess to other owners objects?
RegardsUse the 4-part name server.db.owner.object
joe.
"Praveen" <apveen@.gmail.com> wrote in message
news:1127306421.920830.60330@.g14g2000cwa.googlegroups.com...
>I have one doubt.
> I have created one user "Testuser" and it is asssined to public role.
> The created user does not have create table permission by default. What
> i did was i have granted create table permission to "Testuser" from my
> sa login. I have created one table called "permission_test" using
> "Testuser". Now "Testuser" become the owner of this table.
>
> i have tried access the table from the Testuser. I can do it.
>
> Now the problem is that if i have tried access the table from my sa
> login. i.e
> select * from "permission_test" I got the error saying that "Invalid
> object name 'permission_test'"
>
> Then i have executed the follwing statment from my testuser
>
> grant select on permission_test to dbo
>
> after this i am getting follwing errors "Invalid object name
> 'permission_test'"
>
> What should i do to avoid this problem?
>
> My doubt is that,if the owner is different from the DBO, then DBO could
> not have any acess to other owners objects?
>
> Regards
>
I have created one user "Testuser" and it is asssined to public role.
The created user does not have create table permission by default. What
i did was i have granted create table permission to "Testuser" from my
sa login. I have created one table called "permission_test" using
"Testuser". Now "Testuser" become the owner of this table.
i have tried access the table from the Testuser. I can do it.
Now the problem is that if i have tried access the table from my sa
login. i.e
select * from "permission_test" I got the error saying that "Invalid
object name 'permission_test'"
Then i have executed the follwing statment from my testuser
grant select on permission_test to dbo
after this i am getting follwing errors "Invalid object name
'permission_test'"
What should i do to avoid this problem?
My doubt is that,if the owner is different from the DBO, then DBO could
not have any acess to other owners objects?
RegardsUse the 4-part name server.db.owner.object
joe.
"Praveen" <apveen@.gmail.com> wrote in message
news:1127306421.920830.60330@.g14g2000cwa.googlegroups.com...
>I have one doubt.
> I have created one user "Testuser" and it is asssined to public role.
> The created user does not have create table permission by default. What
> i did was i have granted create table permission to "Testuser" from my
> sa login. I have created one table called "permission_test" using
> "Testuser". Now "Testuser" become the owner of this table.
>
> i have tried access the table from the Testuser. I can do it.
>
> Now the problem is that if i have tried access the table from my sa
> login. i.e
> select * from "permission_test" I got the error saying that "Invalid
> object name 'permission_test'"
>
> Then i have executed the follwing statment from my testuser
>
> grant select on permission_test to dbo
>
> after this i am getting follwing errors "Invalid object name
> 'permission_test'"
>
> What should i do to avoid this problem?
>
> My doubt is that,if the owner is different from the DBO, then DBO could
> not have any acess to other owners objects?
>
> Regards
>
Friday, March 23, 2012
GRANT error in SQL 2005: GRANT SELECT ON sysprocesses TO PUBLIC
The following GRANT statement used to work in SQL 7.0 and 2000, but due to
security enhancements in SQL 2005, it does not work anymore.
GRANT SELECT ON sysprocesses TO PUBLIC
I receive the message:
Msg 4610, Level 16, State 1, Line 2
You can only grant or revoke permissions on objects in the current database.
I have just installed SQL 2005 Beta 3, connected as 'sa' and I have not
modified any security at all in SQL 2005.
Does anybody knows how can I make it work?
And what are the changes in SQL 2005 Security?
If you can send info about it it would be great.
Best regardsTry USE <DBNAME> before executing the grant.
"Alex CT" <AlexCT@.discussions.microsoft.com> wrote in message
news:9F313976-07F1-4099-9A31-ED58153979C2@.microsoft.com...
> The following GRANT statement used to work in SQL 7.0 and 2000, but due to
> security enhancements in SQL 2005, it does not work anymore.
> GRANT SELECT ON sysprocesses TO PUBLIC
> I receive the message:
> Msg 4610, Level 16, State 1, Line 2
> You can only grant or revoke permissions on objects in the current
database.
> I have just installed SQL 2005 Beta 3, connected as 'sa' and I have not
> modified any security at all in SQL 2005.
> Does anybody knows how can I make it work?
> And what are the changes in SQL 2005 Security?
> If you can send info about it it would be great.
> Best regards|||I dont know but I am very curious about where you got Beta 3 ?
Chris
Alex CT wrote:
> The following GRANT statement used to work in SQL 7.0 and 2000, but
due to
> security enhancements in SQL 2005, it does not work anymore.
> GRANT SELECT ON sysprocesses TO PUBLIC
> I receive the message:
> Msg 4610, Level 16, State 1, Line 2
> You can only grant or revoke permissions on objects in the current
database.
> I have just installed SQL 2005 Beta 3, connected as 'sa' and I have
not
> modified any security at all in SQL 2005.
> Does anybody knows how can I make it work?
> And what are the changes in SQL 2005 Security?
> If you can send info about it it would be great.
> Best regards
security enhancements in SQL 2005, it does not work anymore.
GRANT SELECT ON sysprocesses TO PUBLIC
I receive the message:
Msg 4610, Level 16, State 1, Line 2
You can only grant or revoke permissions on objects in the current database.
I have just installed SQL 2005 Beta 3, connected as 'sa' and I have not
modified any security at all in SQL 2005.
Does anybody knows how can I make it work?
And what are the changes in SQL 2005 Security?
If you can send info about it it would be great.
Best regardsTry USE <DBNAME> before executing the grant.
"Alex CT" <AlexCT@.discussions.microsoft.com> wrote in message
news:9F313976-07F1-4099-9A31-ED58153979C2@.microsoft.com...
> The following GRANT statement used to work in SQL 7.0 and 2000, but due to
> security enhancements in SQL 2005, it does not work anymore.
> GRANT SELECT ON sysprocesses TO PUBLIC
> I receive the message:
> Msg 4610, Level 16, State 1, Line 2
> You can only grant or revoke permissions on objects in the current
database.
> I have just installed SQL 2005 Beta 3, connected as 'sa' and I have not
> modified any security at all in SQL 2005.
> Does anybody knows how can I make it work?
> And what are the changes in SQL 2005 Security?
> If you can send info about it it would be great.
> Best regards|||I dont know but I am very curious about where you got Beta 3 ?
Chris
Alex CT wrote:
> The following GRANT statement used to work in SQL 7.0 and 2000, but
due to
> security enhancements in SQL 2005, it does not work anymore.
> GRANT SELECT ON sysprocesses TO PUBLIC
> I receive the message:
> Msg 4610, Level 16, State 1, Line 2
> You can only grant or revoke permissions on objects in the current
database.
> I have just installed SQL 2005 Beta 3, connected as 'sa' and I have
not
> modified any security at all in SQL 2005.
> Does anybody knows how can I make it work?
> And what are the changes in SQL 2005 Security?
> If you can send info about it it would be great.
> Best regards
Friday, March 9, 2012
good index?
Xref: TK2MSFTNGP08.phx.gbl microsoft.public.sqlserver.server:417616
Hi,
I have a table with
smallint,
smallint,
smalldatetime,
smallint
I made a clustered primary key containg the first 3 colomns.
Inserts are something like:
1,1,12:00,2
1,2,12:00,2
2,1,12:00,2
2,2,12:00,2
1,1,12:10,2
1,2,12:10,2
2,1,12:10,2
2,2,12:10,2
But a lot more rows of course. No updating or deleting.
I assume reindexing is not necessary because I select in the inserted order.
Am I right assuming this?
Thanks
Frank
Keep these points in mind when considering using a clustered index;
* The physical ordering supports the range retrievals of important queries
* The cluster index key is used in the ORDER BY or GROUP BY clause
* The cluster index key is used in important joins relating multiple tables
* The cluster index columns are not changed regularly.
"Frank" wrote:
> Hi,
> I have a table with
> smallint,
> smallint,
> smalldatetime,
> smallint
> I made a clustered primary key containg the first 3 colomns.
> Inserts are something like:
> 1,1,12:00,2
> 1,2,12:00,2
> 2,1,12:00,2
> 2,2,12:00,2
> 1,1,12:10,2
> 1,2,12:10,2
> 2,1,12:10,2
> 2,2,12:10,2
> But a lot more rows of course. No updating or deleting.
> I assume reindexing is not necessary because I select in the inserted order.
> Am I right assuming this?
> Thanks
> Frank
>
>
|||Check Scan Density of the index time to time using DBCC Showcontig.
If its less then 75-80% then either reindex it or defrag it using DBCC
Indexdefrag.
Thanks
Hi,
I have a table with
smallint,
smallint,
smalldatetime,
smallint
I made a clustered primary key containg the first 3 colomns.
Inserts are something like:
1,1,12:00,2
1,2,12:00,2
2,1,12:00,2
2,2,12:00,2
1,1,12:10,2
1,2,12:10,2
2,1,12:10,2
2,2,12:10,2
But a lot more rows of course. No updating or deleting.
I assume reindexing is not necessary because I select in the inserted order.
Am I right assuming this?
Thanks
Frank
Keep these points in mind when considering using a clustered index;
* The physical ordering supports the range retrievals of important queries
* The cluster index key is used in the ORDER BY or GROUP BY clause
* The cluster index key is used in important joins relating multiple tables
* The cluster index columns are not changed regularly.
"Frank" wrote:
> Hi,
> I have a table with
> smallint,
> smallint,
> smalldatetime,
> smallint
> I made a clustered primary key containg the first 3 colomns.
> Inserts are something like:
> 1,1,12:00,2
> 1,2,12:00,2
> 2,1,12:00,2
> 2,2,12:00,2
> 1,1,12:10,2
> 1,2,12:10,2
> 2,1,12:10,2
> 2,2,12:10,2
> But a lot more rows of course. No updating or deleting.
> I assume reindexing is not necessary because I select in the inserted order.
> Am I right assuming this?
> Thanks
> Frank
>
>
|||Check Scan Density of the index time to time using DBCC Showcontig.
If its less then 75-80% then either reindex it or defrag it using DBCC
Indexdefrag.
Thanks
Labels:
clustered,
database,
gbl,
index,
microsoft,
mysql,
oracle,
phx,
public,
server,
server417616hi,
smalldatetime,
smallint,
smallinti,
sql,
sqlserver,
table,
tk2msftngp08,
withsmallint,
xref
good index?
Xref: TK2MSFTNGP08.phx.gbl microsoft.public.sqlserver.server:417616
Hi,
I have a table with
smallint,
smallint,
smalldatetime,
smallint
I made a clustered primary key containg the first 3 colomns.
Inserts are something like:
1,1,12:00,2
1,2,12:00,2
2,1,12:00,2
2,2,12:00,2
1,1,12:10,2
1,2,12:10,2
2,1,12:10,2
2,2,12:10,2
But a lot more rows of course. No updating or deleting.
I assume reindexing is not necessary because I select in the inserted order.
Am I right assuming this?
Thanks
FrankKeep these points in mind when considering using a clustered index;
* The physical ordering supports the range retrievals of important queries
* The cluster index key is used in the ORDER BY or GROUP BY clause
* The cluster index key is used in important joins relating multiple tables
* The cluster index columns are not changed regularly.
"Frank" wrote:
> Hi,
> I have a table with
> smallint,
> smallint,
> smalldatetime,
> smallint
> I made a clustered primary key containg the first 3 colomns.
> Inserts are something like:
> 1,1,12:00,2
> 1,2,12:00,2
> 2,1,12:00,2
> 2,2,12:00,2
> 1,1,12:10,2
> 1,2,12:10,2
> 2,1,12:10,2
> 2,2,12:10,2
> But a lot more rows of course. No updating or deleting.
> I assume reindexing is not necessary because I select in the inserted orde
r.
> Am I right assuming this?
> Thanks
> Frank
>
>|||Check Scan Density of the index time to time using DBCC Showcontig.
If its less then 75-80% then either reindex it or defrag it using DBCC
Indexdefrag.
Thanks
Hi,
I have a table with
smallint,
smallint,
smalldatetime,
smallint
I made a clustered primary key containg the first 3 colomns.
Inserts are something like:
1,1,12:00,2
1,2,12:00,2
2,1,12:00,2
2,2,12:00,2
1,1,12:10,2
1,2,12:10,2
2,1,12:10,2
2,2,12:10,2
But a lot more rows of course. No updating or deleting.
I assume reindexing is not necessary because I select in the inserted order.
Am I right assuming this?
Thanks
FrankKeep these points in mind when considering using a clustered index;
* The physical ordering supports the range retrievals of important queries
* The cluster index key is used in the ORDER BY or GROUP BY clause
* The cluster index key is used in important joins relating multiple tables
* The cluster index columns are not changed regularly.
"Frank" wrote:
> Hi,
> I have a table with
> smallint,
> smallint,
> smalldatetime,
> smallint
> I made a clustered primary key containg the first 3 colomns.
> Inserts are something like:
> 1,1,12:00,2
> 1,2,12:00,2
> 2,1,12:00,2
> 2,2,12:00,2
> 1,1,12:10,2
> 1,2,12:10,2
> 2,1,12:10,2
> 2,2,12:10,2
> But a lot more rows of course. No updating or deleting.
> I assume reindexing is not necessary because I select in the inserted orde
r.
> Am I right assuming this?
> Thanks
> Frank
>
>|||Check Scan Density of the index time to time using DBCC Showcontig.
If its less then 75-80% then either reindex it or defrag it using DBCC
Indexdefrag.
Thanks
Labels:
clustered,
database,
gbl,
index,
microsoft,
mysql,
oracle,
phx,
public,
server,
server417616hi,
smalldatetime,
smallint,
smallinti,
sql,
sqlserver,
table,
tk2msftngp08,
withsmallint,
xref
Friday, February 24, 2012
Global Function in 2005
Hi,
I'm trying to create a global function in SQL Server 2005. I mean, a
function similar to GETDATE(), that is public for all databases.
This is possible in SQL Server 2000, but I don't find any similar in
2005
Thanks in advance
--
--
--
Un saludo
--
---
"Slo s que no s nada. " (Scrates)Carlos Sacristn (csacristanARROBAmvpsPUNTOorg) writes:
> I'm trying to create a global function in SQL Server 2005. I mean, a
> function similar to GETDATE(), that is public for all databases.
> This is possible in SQL Server 2000, but I don't find any similar in
> 2005
I guess this was possible in SQL 2000 by creating functions in master and
make them look like system functions as fn_get_trace_status(). However,
that was entirely unsupported.
In SQL 2005, system procedures and system functions are stored in the
invisible resource database.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||Thanks Edgar,
I know this was unsupported, but the applications that actually run
against SQL Server 2000 use this feature, so I trying to do the same in
2005. Do you know any way to get something similar?
I try with synonyms, but it's no possible
--
--
--
Un saludo
--
---
"Slo s que no s nada. " (Scrates)
"Erland Sommarskog" <esquel@.sommarskog.se> escribi en el mensaje
news:Xns97D38A59F23A4Yazorman@.127.0.0.1...
> Carlos Sacristn (csacristanARROBAmvpsPUNTOorg) writes:
> I guess this was possible in SQL 2000 by creating functions in master and
> make them look like system functions as fn_get_trace_status(). However,
> that was entirely unsupported.
> In SQL 2005, system procedures and system functions are stored in the
> invisible resource database.
>
> --
> Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/pr...oads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodin...ions/books.mspx|||Carlos Sacristn (csacristanARROBAmvpsPUNTOorg) writes:
> I know this was unsupported, but the applications that actually run
> against SQL Server 2000 use this feature, so I trying to do the same in
> 2005. Do you know any way to get something similar?
Moral: don't rely on unsupported and undocumented behaviour.
> I try with synonyms, but it's no possible
Synonyms sounds as the best bet, but you would have to install them in
every database. And the functions can not operate on tables in the local
database.
You will have to back to the drawing-board, I guess.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||Bad news, really...
In my case, I don't need the functions to operate with tables. There are
scalar function, for example, something like
CREATE FUNCTION dbo.fn_Trim (@.par VARCHAR(8000))
RETURNS VARCHAR(8000)
AS
BEGIN
RETURN RTRIM(LTRIM(@.par))
END
I think that the possibility to create this type of scalar-functions
(globals for all databases) could be an interesting feature.
Anyway, thanks for your help Erland
--
--
--
Un saludo
--
---
"Slo s que no s nada. " (Scrates)
"Erland Sommarskog" <esquel@.sommarskog.se> escribi en el mensaje
news:Xns97D39FFD079A1Yazorman@.127.0.0.1...
> Carlos Sacristn (csacristanARROBAmvpsPUNTOorg) writes:
> Moral: don't rely on unsupported and undocumented behaviour.
>
> Synonyms sounds as the best bet, but you would have to install them in
> every database. And the functions can not operate on tables in the local
> database.
> You will have to back to the drawing-board, I guess.
> --
> Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/pr...oads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodin...ions/books.mspx|||Carlos Sacristn (csacristanARROBAmvpsPUNTOorg) writes:
> In my case, I don't need the functions to operate with tables. There
> are scalar function, for example, something like
> CREATE FUNCTION dbo.fn_Trim (@.par VARCHAR(8000))
> RETURNS VARCHAR(8000)
> AS
> BEGIN
> RETURN RTRIM(LTRIM(@.par))
> END
> I think that the possibility to create this type of scalar-functions
> (globals for all databases) could be an interesting feature.
On http://lab.msdn.microsoft.com/ProductFeedback/ you can submit a
suggestion for this to be added ot a future release of SQL Server.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx
I'm trying to create a global function in SQL Server 2005. I mean, a
function similar to GETDATE(), that is public for all databases.
This is possible in SQL Server 2000, but I don't find any similar in
2005
Thanks in advance
--
--
--
Un saludo
--
---
"Slo s que no s nada. " (Scrates)Carlos Sacristn (csacristanARROBAmvpsPUNTOorg) writes:
> I'm trying to create a global function in SQL Server 2005. I mean, a
> function similar to GETDATE(), that is public for all databases.
> This is possible in SQL Server 2000, but I don't find any similar in
> 2005
I guess this was possible in SQL 2000 by creating functions in master and
make them look like system functions as fn_get_trace_status(). However,
that was entirely unsupported.
In SQL 2005, system procedures and system functions are stored in the
invisible resource database.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||Thanks Edgar,
I know this was unsupported, but the applications that actually run
against SQL Server 2000 use this feature, so I trying to do the same in
2005. Do you know any way to get something similar?
I try with synonyms, but it's no possible
--
--
--
Un saludo
--
---
"Slo s que no s nada. " (Scrates)
"Erland Sommarskog" <esquel@.sommarskog.se> escribi en el mensaje
news:Xns97D38A59F23A4Yazorman@.127.0.0.1...
> Carlos Sacristn (csacristanARROBAmvpsPUNTOorg) writes:
> I guess this was possible in SQL 2000 by creating functions in master and
> make them look like system functions as fn_get_trace_status(). However,
> that was entirely unsupported.
> In SQL 2005, system procedures and system functions are stored in the
> invisible resource database.
>
> --
> Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/pr...oads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodin...ions/books.mspx|||Carlos Sacristn (csacristanARROBAmvpsPUNTOorg) writes:
> I know this was unsupported, but the applications that actually run
> against SQL Server 2000 use this feature, so I trying to do the same in
> 2005. Do you know any way to get something similar?
Moral: don't rely on unsupported and undocumented behaviour.
> I try with synonyms, but it's no possible
Synonyms sounds as the best bet, but you would have to install them in
every database. And the functions can not operate on tables in the local
database.
You will have to back to the drawing-board, I guess.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||Bad news, really...
In my case, I don't need the functions to operate with tables. There are
scalar function, for example, something like
CREATE FUNCTION dbo.fn_Trim (@.par VARCHAR(8000))
RETURNS VARCHAR(8000)
AS
BEGIN
RETURN RTRIM(LTRIM(@.par))
END
I think that the possibility to create this type of scalar-functions
(globals for all databases) could be an interesting feature.
Anyway, thanks for your help Erland
--
--
--
Un saludo
--
---
"Slo s que no s nada. " (Scrates)
"Erland Sommarskog" <esquel@.sommarskog.se> escribi en el mensaje
news:Xns97D39FFD079A1Yazorman@.127.0.0.1...
> Carlos Sacristn (csacristanARROBAmvpsPUNTOorg) writes:
> Moral: don't rely on unsupported and undocumented behaviour.
>
> Synonyms sounds as the best bet, but you would have to install them in
> every database. And the functions can not operate on tables in the local
> database.
> You will have to back to the drawing-board, I guess.
> --
> Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/pr...oads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodin...ions/books.mspx|||Carlos Sacristn (csacristanARROBAmvpsPUNTOorg) writes:
> In my case, I don't need the functions to operate with tables. There
> are scalar function, for example, something like
> CREATE FUNCTION dbo.fn_Trim (@.par VARCHAR(8000))
> RETURNS VARCHAR(8000)
> AS
> BEGIN
> RETURN RTRIM(LTRIM(@.par))
> END
> I think that the possibility to create this type of scalar-functions
> (globals for all databases) could be an interesting feature.
On http://lab.msdn.microsoft.com/ProductFeedback/ you can submit a
suggestion for this to be added ot a future release of SQL Server.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx
Sunday, February 19, 2012
global code
Hi ,
I wrote a function in the report property code :
Public Function AA(field as string)
AA = field
End Function
When I try to write an expretion like :
=AA(Me.Value)
I get and error of AA is not recognize.
What is the problem ?
10x.You need to call your function as =Code.AA(Me.Value) . This will
solve your problem mentioned error.
I am doubtfull about what you exactly mean by Me.Vlaue
Hope this helps.
Thanks,
Mahesh
I wrote a function in the report property code :
Public Function AA(field as string)
AA = field
End Function
When I try to write an expretion like :
=AA(Me.Value)
I get and error of AA is not recognize.
What is the problem ?
10x.You need to call your function as =Code.AA(Me.Value) . This will
solve your problem mentioned error.
I am doubtfull about what you exactly mean by Me.Vlaue
Hope this helps.
Thanks,
Mahesh
Subscribe to:
Posts (Atom)