Create DB Role Owned By Public

Jul 20, 2007

I use the following script in order to create db role:

USE [MyDB]GOCREATE ROLE [myRole] AUTHORIZATION [public]GO

It doesn't work:
Msg 15405, Level 16, State 1, Line 1
Cannot use the special principal 'public'.

However this code works fine:

USE [MyDB]GOCREATE ROLE [myRole] AUTHORIZATION [dbo]GOALTER AUTHORIZATION ON ROLE::[myRole] TO [public]GO

So the question is why?

View 6 Replies


ADVERTISEMENT

Only Members Of Sysadmin Role Are Allowed To Update Or Delete Jobs Owned By A Different Login

Mar 7, 2007



Question to those who may have had this same error- it seems that I am not able to delete some of the reports that I have created. This just started happening recently and according to our system admin nothing has changed as far as permissions are concernced. We installed SP2 the other day and I was wondering if this could have anything to do with the error message below

by the way I am a member of the sysadmin group

thanks in advance

km

System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Data.SqlClient.SqlException: Only members of sysadmin role are allowed to update or delete jobs owned by a different login. Only members of sysadmin role are allowed to update or delete jobs owned by a different login. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at Microsoft.ReportingServices.Library.InstrumentedSqlCommand.ExecuteNonQuery() at Microsoft.ReportingServices.Library.DBInterface.DeleteObject(String objectName) at Microsoft.ReportingServices.Library.RSService._DeleteItem(String item) at Microsoft.ReportingServices.Library.RSService.ExecuteBatch(Guid batchId) at Microsoft.ReportingServices.WebServer.ReportingService2005.ExecuteBatch() --- End of inner exception stack trace ---

View 12 Replies View Related

Public Role

May 13, 2002

I am new at this and we encountered a problem. Can names in the public role be deleted? We have some names that need to go - however the delete option does not high light?

I would appreciate your help..

View 8 Replies View Related

Dt_ Procs And The Public Role

Oct 3, 2006

In a SQL 2k instance (latest SP) some of my user databases show the public role with execute on a variety of stored procs named dt_* (i.e. dt_addtosourcecontrol). However, not all the user databases do this, some do not grant the public role execute on these procs .

So, can someone explain what generates these permissions and is it acceptable to remove them? If I have a database that does not grant public access, should I be concerned? I don't see any reference to these procs in BOL.

TIA,

Moblex

View 1 Replies View Related

Copy Public Role

Aug 24, 2007

Is it possible to script the Public role? Delete authorities granted to Public?

I need to copy all the permissions of the Public role from one database to many others. The databases were setup incorrectly with many authorities granted to Public.

View 1 Replies View Related

Public Server Role

Mar 30, 2006

In exploring permissions that users have, I find that they all have VIEW ANY DATABASE permission which they inherit from the public server role. You can see this by selecting the Permissions page on the Server Properties dialog and highlighting "public". The permission shows as having been granted by sa. This is listed as a server role. However, it does not show in the list of server roles and I can't find any documentation for it (RTM BOL). Interestingly, if I revoke this permission (which is the only permission this role has), the public server role disappears from view. But I can subsequently regrant the permission with Transact-SQL in master and the role comes back.

I would like more information about this role. It seems to be sort of "secret".

When I revoke the permission, users can't see any databases except master and tempdb (both of which have active guest users) even though they have been granted access to other databases.

What I was trying to accomplish by changing this permission was to allow a user to see only those databases which they are allowed to use. But that does not seem to be possible.

Thanks for the help.

Sharon

View 5 Replies View Related

Removing Login's From Public Role

May 24, 2000

Hello all,

I'm having trouble copying my production database to a development version because I have a login user in the public role that is not a valid user. I can't find any reference to the login/user anywhere in my database or in NT security, on my server for that matter.

When I open the public role through Enterprise Manager, I can see the logins/users in the list, but the 'Remove' button is disabled. I also tried to use the stored procedure 'sp_droprolemember', but it says that 'public' is not a role in the database.

DTS keeps blowing up on this object when exporting, and I need to get this stuff copied ASAP.

Thanks for all help

Kevin

View 1 Replies View Related

What Permissions Has By Default Public Role?

Mar 27, 2008

Can someone tell me what permissions has public role in sql server? can it read every table or it can just connect to a database and no more?

thanks

View 1 Replies View Related

Public Role And Explicit Rights

Sep 19, 2005

I gave a developer rights to the Public role on a SQL Server 2000 database.  The Public role only has explicitly set select rights to the system tables and one user table.  There are no other explicit rights set.  The developer was able to open a table that had no rights set in enterprise manager and change data.  Is this possible?

View 1 Replies View Related

Unable To Remove User From Public Role ?

Dec 22, 2000

Can anybody explain what database user with a prefix of "" in the public role indicates. I have the same two users in every database and cannot remove them?

Any help would be gratefully received.

View 4 Replies View Related

Reseting Select Permissions For Public Role

Sep 13, 2004

Every night, there are some stored procedures that run to recreate tables so that the information in the table is updated. After the tables are droped and recreated I have to go in and check the select box under the permissions for the public role. If i don't do this users will not be able to select from theres tables.

What can I do so that users are able to select from these tables after they are created?

Would you be able to specify the select permissions for the public role in the script that creates the table or run a script that gives all those tables select permissions for the public role?

All help is appreciated.

View 2 Replies View Related

Dbo Owned Stored Procedure Hitting Another User Owned Table

Aug 13, 2007

I am trying to come up with a solution that does not involve having a version of every stored procedure for every user I have...
Here is the problem...

I am going to have multiple users that need to have their own "product table". The structures are going to be the same for all. We currently only have one user and it is a DBO... all stored procedures are dbo.[sp name]... is there any way to get it so that the product table in the SP will be the user owned product table and not the dbo table??

I have tried just taking out the dbo prefix with no luck... the user's default schema will match the table they own so when they do a straight select they get the right information but it is just the SPs that I can't seem to get to work...

The only thing that I have come up with is making the SPs dynamic with having the username as parameter.

Is there anything else I can try??


and SQL 2005 SP2 on Win 2003 SP2

View 2 Replies View Related

Revoking Permissions On System Tables To The Public Role.

Oct 14, 2004

We have an audit issue that is requiring me to revoke the select permissions from the public role to the system tables. Has anyone had to do this?? What problems did you experience? Are their any tables that you were not able to change the permissions on? Any help is greatly appreciated.

View 5 Replies View Related

How To List Permissions For Public Role For A Database In SQL Server

Oct 17, 2007

Hello,
Does anybody have the transact SQL to find the permissions granted to the public role in a Database ?

Also looking for the SQL to find the permissions granted to the user Guest in a database ?


thanks

View 5 Replies View Related

Public Role And Guest Security Concern In SQL 2000 SP4

Sep 8, 2006

Hi all,

I have setup a new SQL 2000 SP4 and internal auditor query about revoke permission from Public role and remove guest from all databases.

1. Can I revoke all default permissions (select on system tables in all DBs) from "Public" role? I am concern any error after such action.

2. I found that guest account in DB -- master, tempdb and msdb. According to Microsoft documents. The account should not remove and can't from master and tempdb. How about msdb?

Thanks,

Regards,

Edwin

View 7 Replies View Related

Determine User Assigned Rights To Public Role

Oct 10, 2007

Hi:

When I restore DB from testing to production, we want to remove extra access rights granted to public group. Is there a simple way to query to find out for which objects (table, view, sp, fn) that public group were granted select, delete, update insert, or execute rights?

My objective is to write a sp to remove all user assigned rights to public group (role), but not to deny any rights. How to do it?


Any suggestion will be appreciated.

View 1 Replies View Related

Create Public Synonym

Jul 15, 2006

I get an error in query analyzer when running (parsing query):

CREATE PUBLIC SYNONYM LIB_GROUP_PERMITS FOR LIB_GROUP_PERMITS;

with an error of:

"Server: Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'PUBLIC'."

Can anyone help me at all please!

Thanks!

View 3 Replies View Related

Cannot Create Table Called "Public", Or Field "Primary", What Else??

Feb 23, 2001

I'm trying to get a SQL 7 and 6.5 DB to interact, but while there is no problem in SQL7, I cannot create a table called "Public" or a field called "Primary"!!
Does anyone know why this might be and if so where I might get a list of any other "invalid" names??

Thanks in advance,

Damon

View 1 Replies View Related

Create Database Role Via T-SQL

Feb 23, 2008

I have created the functionality to dynamically create databases and am now trying to figure out how to create database roles using T-SQL.

I keep finding information about the sp_addrole stored procedure which is the first step, but how do you go about defining what permissions this role has via T-SQL?

Thanks

View 3 Replies View Related

Create Database With Application Role...

Mar 22, 2007

Hi,

I want my application to create database and I do the following things:

1)Create application role
2)Grant create database to application role
3)Activate application role
4)Create database

and I get the answer:

CREATE DATABASE permission denied in database 'master'.

View 1 Replies View Related

Create User - Permit In Database Role

Jan 7, 2004

Hi,
I hv an application which is using ASP.net. The connectionstring in web.config is
<appSettings>
<add key = "constring" value = "Initial Catalog=mydatabase;Data Source=mypc-pc;User ID=User1; Password=password1"/>
</appSettings>"

Then, i hv created a user in SQL Server 2000 which is User1. What should i put for the database role? db_owner or just db_datareader and db_datawriter?

pls help.

Thnx

View 4 Replies View Related

SP Error When Trying To Create User And Assign A Role

Aug 23, 2002

I get the following errors associated with trying to create an SP.

Server: Msg 170, Level 15, State 1, Procedure AddFortuneUser, Line 8
Line 8: Incorrect syntax near '@newuser'.
Server: Msg 137, Level 15, State 2, Line 1
Must declare the variable '@newuser'.

Can anyone explain why I have to do a declare.
I suspect I have to issue "declare @newuser sysname" somewhere but I'm not sure why.

The following is the code I'm trying to run.
My intent would be to create a form for the Admin Clerk that would call this SP. That way they can create a generic login. They have an application that allows them to change the password after the fact.
/*
Created for Admin person to allow them to add a basic SQL Login Account
forcing the user to be a member of a specific role 'helmsman'
in a specific database 'Fortune'
*/
CREATE PROCEDURE AddFortuneUser
@newuser char(128)
AS
EXEC master..sp_addlogin @loginame=@newuser, @passwd =substring(@newuser,1,8), @defdb =Fortune
GO
if not exists (select * from dbo.sysusers where name = @newuser and uid < 16382)
EXEC sp_grantdbaccess @loginame=@newuser, @name_in_db=@newuser
GO
exec master..sp_addrolemember @rolename ='helmsman', @membername =@newuser
GO

View 1 Replies View Related

Do We Always Have To Create Name Calculation For Role-playing Dimension?

Jul 10, 2007

Hi, dear friends,

Just found that I am not able to ignore the name column property for role-palying dimension even though I only select one of the key columns for this dimension in the mining structure where the role-playing dimension is used? E.g I have a fact table (which is the case table for the mining structure) which is related to the role-playing date dimension. The schema is as following:

Dim_event_day_time_key

Dim_carrier_day_time_key

Dim_domain_day_time_key

.....................................

and other attibutes in the fact table.

When I dragged the 'hours' attribute from the dim_day_time table to the mining structure, if I left the key columns of 'Hours' as the above 3 columns, then I have to select a name column, by then I dont have a name column in the dimension table yet. Therefore I want to jsut select one key column as the key of that role-playing dimension in the mining structure, but then I am not able to ignore the 'name column' property as it still always asks me to select the 'name column' for that.



Therefore my question is: we are not allowed to select only one key columns in the mining structure for the role-playing dimension? And we will have to always go to the data source view to create a named calculation as the new column for the role-playing dimension?



Hope my question is clear for your advices and I am looking forward to hearing from you shortly.



Thanks a lot in advance.



With best regards,



Yours sincerely,

View 1 Replies View Related

SQL 2012 :: Grant Statements To Create Userdefined Role

May 11, 2015

Need to create a user defined role with grant permissions for below .

View Definition
Execute all Function
Grant View
Grant Synonym
dbo
View Definition
Not getting grant statements for above permissions.

I mean like below.

-----------------------------------------------------------------
CREATE ROLE [Role1]
GRANT EXECUTE ON SCHEMA ::dbo TO [Role1]
-----------------------------------------------------------------

View 1 Replies View Related

Restrict Role To CREATE TABLE On An Assigned SCHEMA

May 9, 2008

Can anyone help me with this? The objective is to allow an application user (with db_datareader & db_datawriter database roles assigned) to be able to create tables in the assigned schema (dbo) via a new role.


-- Create User

use master

go

create login DBA with password='xx', CHECK_EXPIRATION=ON, CHECK_POLICY=ON

use AdventureWorks

go

create user dba from login DBA
alter user dba with DEFAULT_SCHEMA=dbo

go

-- Create Role

use AdventureWorks

go

create role sp_ddl_role AUTHORIZATION dbo

grant CREATE TABLE to sp_ddl_role



-- assign user to Role

use AdventureWorks

go

exec sp_addrolemember sp_ddl_role, dba

go

-- Create Table statement then run with following error
Error:

Msg 2760, Level 16, State 1, Line 1

The specified schema name "dbo" either does not exist or you do not have permission to use it.

Remedy: Grant ALTER on schema::dbo to sp_ddl_role

My problem is that I want to restrict user permissions via this role to just the CREATE TABLE and granting ALTER on a SCHEMA will open up a whole lot more permissions from a security standpoint.

Question: How do I restirct this role to just the CREATE TABLE within a SCHEMA?

View 1 Replies View Related

Report Builder Model Generation - How To Create A Key Attribute Along With The Role?

Mar 28, 2007

Hi,



I have found that in the autogenerated model attributes are missing for those fields that have relations to other tables. At first, it may look reasonable since a user can still get down to the field's value through the relation/related table. However, if the relation's key fields is the only thing the user wants to display, then going down to the related table is an overkill.

I can add an attribute manually and bind it to the key field(s). Is there an option in the autogeneration process to do it automatically? The only post I've found so far suggests to do everything manually (http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1152575&SiteID=1). Is this the only way?



Thank you,

Leonid

View 3 Replies View Related

SQL Security :: How To Create A Low Privilege User And Role For Server Session State

May 26, 2015

An old website I inherited uses sa to connect to SQL SessionState and had the details in the web.config. This is bad for security.The session state database is of -sstype "t" which is defined as:Temporary. Session state data is stored in the SQL Server tempdb database. Stored procedures for managing session state are installed in the SQL Server ASPState database. Data is not persisted if you restart SQL. This is the default.What kind of WIndows user, SQL Login, role and permissions do I need to create to make Session State secure? (Windows Server 2012 and SQL Server 2012 mixed mode authentication, Webfarm).

View 4 Replies View Related

Recommended Owned Of A DataBase

Jan 18, 2002

Hi,
What are current thoughts about who should own a Database?
I see 3 possibilities:
1. The DOMAINAdministrator (person wo starts up the Server at Bootup)
2. 'sa', or
3. a person/user closely tied to the database.

reasons for each?

Thanks for your opinions.
MichaelG

View 1 Replies View Related

Can't Connect To Any Database Not Owned By ServernameASPNET

Feb 9, 2007

I'm developing an intranet application and am using the Express versions of VWD and SQL Server 2005 for initial development before obtaining full licensed versions.
Database connections work fine when testing from within VWD but when testing from browser, unless the database owner is the IIS servernameASPNET, there are various errors depending on the specific connection settings, i.e.
Login failed for user ''. The user is not associated with a trusted SQL Server connection. -
Receive this error when a GridView is connected to a remote SSE db.
--- 
SELECT permission denied on object 'Table_1', database 'TEST', schema 'dbo'.
Receive this error when GridView is connected to local SSE db not owned by servernameASPNET.
--- 
 Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.
This happens when using any control that is connected to SSE db created in VWD and stored in App_Data folder (owner is the user logon name)
--- 
Any help or ideas would be appreciated. I want to have all local data stored in App_Data folder.
Thank you.

View 1 Replies View Related

Look Up For DB Owner And Return Names Of DB&#39;s Not Owned By &#39;Sa&#39;.....

Oct 10, 2001

Hi,
I need to write a stored procedure,that look's up the owner of each database on an server and returns the names of the databases which are not owned by SA.
Can we do this..if so how??

TIA

View 1 Replies View Related

Can't Get The Complete List Of Tables Owned By The Dbo

Oct 10, 2005

Hi,

View 12 Replies View Related

Sql 2005 Database Role Vs Application Role ?

May 18, 2007

Ive been reading over the documentation and some stuff online, but I still dont really understand what the difference is and when you would use one vs the other. Can someone put it in simple terms for this dummy (me) ?

thanks

View 2 Replies View Related

Making Restricted User To See Only The Database That Is Owned By It.....!

Feb 7, 2008

How would I hide the sa account to be accessible under Logins for a restricted User in sql server 2005 and also other folders like Replication, Managment, etc need to be hidden too.



any idea,

thank,s

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved