Showing posts with label roles. Show all posts
Showing posts with label roles. Show all posts

Monday, March 12, 2012

How can a non-admin see all system catalog data?

I have given the following SQL to database user who with db_SecurityAdmin & db_AccessAdmin database roles. He doesn't see any more than his data when he runs it. I am an sa on the database and see all of the data. What security does he need in order to pull all data as a non-sa or is it possible for a user other than sa to see it all?

The other idea: If this SQL was placed in a stored procedure - would a non-sa be able to pull all of the data from it? Is there a way for them to execute the proc as sa?

SELECT sys.sql_logins.name as Login_name, sys.database_principals.name as Principal_name , sys.database_principals.type_desc , database_principals1 .name AS role_name

FROM sys.database_principals

INNER JOIN

sys.sql_logins on sys.database_principals.sid = sys.sql_logins.sid

INNER JOIN

sys.database_role_members ON sys.database_principals.principal_id = sys.database_role_members.member_principal_id

INNER JOIN

sys.database_principals AS database_principals1 ON sys.database_role_members .role_principal_id = database_principals1.principal_id

Thanks for your help!

You have this user accessing restricted tables.

You could try adding the user to the securityadmin role. If that doesn't work for you, you could create the stored procedure with EXECUTE AS permissions, and then GRANT the user permission to EXECUTE the stored procedure

|||

These are system catalogs - views not tables.

This is what Online books suggested for use as the system tables could change in future releases.

If this is not the correct source for this information, where should it be retrieved from?

|||And these 'views' are accessing restricted system tables.|||

If I place the SQL in a stored procedure,

what do I need to add to ensure that the user can execute it as SA.

I have tried the EXECUTE as 'sa' statement and I must be missing something because it doesn't work.

THANKS!

|||

You don't have to do anything.

Anyone placed in the [sysadmin] Role (sa), can do anything in the server, including, executing any stored procedures. The [sysadmin] Role totally controls the server and all databases on the server.

You might wish to read up on 'Roles' in Books Online.

|||

Even the "public" role as select permission on the catalog views. In 2005, though, this isn't enough, and accounts must be granted "view definition" permissions. For example, this statement grants permission to the "public" role to see all system metadata:

use master; grant view any definition to public

See this for more info:

http://msdn2.microsoft.com/en-us/library/ms175808.aspx

Ron Rice

How can a non-admin see all system catalog data?

I have given the following SQL to database user who with db_SecurityAdmin & db_AccessAdmin database roles. He doesn't see any more than his data when he runs it. I am an sa on the database and see all of the data. What security does he need in order to pull all data as a non-sa or is it possible for a user other than sa to see it all?

The other idea: If this SQL was placed in a stored procedure - would a non-sa be able to pull all of the data from it? Is there a way for them to execute the proc as sa?

SELECT sys.sql_logins.name as Login_name, sys.database_principals.name as Principal_name , sys.database_principals.type_desc , database_principals1 .name AS role_name

FROM sys.database_principals

INNER JOIN

sys.sql_logins on sys.database_principals.sid = sys.sql_logins.sid

INNER JOIN

sys.database_role_members ON sys.database_principals.principal_id = sys.database_role_members.member_principal_id

INNER JOIN

sys.database_principals AS database_principals1 ON sys.database_role_members .role_principal_id = database_principals1.principal_id

Thanks for your help!

You have this user accessing restricted tables.

You could try adding the user to the securityadmin role. If that doesn't work for you, you could create the stored procedure with EXECUTE AS permissions, and then GRANT the user permission to EXECUTE the stored procedure

|||

These are system catalogs - views not tables.

This is what Online books suggested for use as the system tables could change in future releases.

If this is not the correct source for this information, where should it be retrieved from?

|||And these 'views' are accessing restricted system tables.|||

If I place the SQL in a stored procedure,

what do I need to add to ensure that the user can execute it as SA.

I have tried the EXECUTE as 'sa' statement and I must be missing something because it doesn't work.

THANKS!

|||

You don't have to do anything.

Anyone placed in the [sysadmin] Role (sa), can do anything in the server, including, executing any stored procedures. The [sysadmin] Role totally controls the server and all databases on the server.

You might wish to read up on 'Roles' in Books Online.

|||

Even the "public" role as select permission on the catalog views. In 2005, though, this isn't enough, and accounts must be granted "view definition" permissions. For example, this statement grants permission to the "public" role to see all system metadata:

use master; grant view any definition to public

See this for more info:

http://msdn2.microsoft.com/en-us/library/ms175808.aspx

Ron Rice

Friday, March 9, 2012

How allow normal users using profiler

Hi guys,
Is there any way to allow a local users using Profiler without SQL System
Administrator Server Roles?
If yes, how can I do it?
Many Thanks
FrancescoIn 2005: yes (GRANT ALTER TRACE).
In 2000: no.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"RizFra" <RizFra@.discussions.microsoft.com> wrote in message
news:F651A849-72B2-456C-9876-7D5929142D1A@.microsoft.com...
> Hi guys,
> Is there any way to allow a local users using Profiler without SQL System
> Administrator Server Roles?
> If yes, how can I do it?
> Many Thanks
> Francesco|||Thanks Tibor!
"Tibor Karaszi" wrote:
> In 2005: yes (GRANT ALTER TRACE).
> In 2000: no.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "RizFra" <RizFra@.discussions.microsoft.com> wrote in message
> news:F651A849-72B2-456C-9876-7D5929142D1A@.microsoft.com...
> > Hi guys,
> > Is there any way to allow a local users using Profiler without SQL System
> > Administrator Server Roles?
> > If yes, how can I do it?
> >
> > Many Thanks
> > Francesco
>|||This is a way to run Profiler w/o direct SA privileges.
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=47384
- ray|||Thanks Ray
"raybouk" wrote:
> This is a way to run Profiler w/o direct SA privileges.
> http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=47384
> - ray
>

Sunday, February 19, 2012

Hosting aps.net website, sql server 2005 db in App_data or outsite App_data?

I've started with the development of a website which will use a sql server 2005 database. I want to use the asp.net membership and roles functionality. In the end the website will be hosted by a hosting company.

What is the best way to store the database? In the App_data folder or outstide the App_data folder?

Second, do hosting companies support placing sql server databases stored into the App_data folder?

1) app_data - not good idea. the database file in app_data folder maybe will work for you intranet project but in my opinion it is not good idea. It works great when you want to "play" with VWD and SQL express... BTW SQL express is GREAT so use it but do not create databse file ! - just login to your SQL server and create db. When you finish your project backup db and restore on live server.

2) no ! i mean not the one i know :) i work with 10 diffrent hosts and NO they don't. I guess if you will look for one you will find one... but most hosting companies offers full SQL 2005 servers and they don't support app_data folders. What some hosting companies do, they offer tools that will allow you to copy/upgrade your db to SQL 2005

hope this helps