Creating User And Giving Permission To All Databases

Feb 27, 2008



Hi,

Any body please give me some TSQL Stored procedure for

creating an SQL user and to give db access permission to all the databases available on a the server.

Mujeeb

View 5 Replies


ADVERTISEMENT

Getting Problem In Giving Database Permission To Group User

Jun 18, 2007

hi ,

I am getting some problem in using group in sql server login.

i have two NT groups in windows.i) developer and tester

I added a user Lalit in both gruop. I want to give db_owner permission on a particular database(Employee) to developer group and data_denyreader and deny_writer on same database(Employee) to tester group.



Now when i logging in to sql server using Lalit(windows authentication) iam not able to access the database(Employee).



Now my concern is that Lalit should have full access to the employee database when entered as developer user and limited access to employee database when entered as tester user.



how can i achieve this set up????



Please do help.

Thanks a lot in advance !!!!!!!!!!!!!!!!!!

View 1 Replies View Related

Giving Permission .......urgent

Dec 20, 1999

i have a user database called calls. In that database there are about 100 of tables. now i want to give permission to that tables to a new user so what is the easiest way to give permission in a single shot to the 100 of the tables.

I know how to give the object permission to the table. But for 100 talbes it will take a lot of times , isn't it???


thanks in advance.

View 5 Replies View Related

Creating Databases Under MS SQL 2005 Server (SP-2): Dbo User Role

Jun 9, 2007

Good Day,



I am having a problem with creating databases in MS SQL 2005 Server. When I attempt to assign an User Mapping for my SQL user account to the newly created database, the "dbo" user and schema is already assigned. When I try to drop this user in favor of my own, I receive an error message: Cannot alter the user "dbo" (Microsoft SQL Server, Error: 15150). I am connected to my database engine through the "sa" account.



Regards,

Keith

View 6 Replies View Related

Giving Permission To View CERTAIN Records

Dec 4, 2006

I've been looking through permissions to see if it's possible to grant a user permission to see only certain records from a table.

For example:

I'm granting users to view records in the table 'Sales', but I only want the users to see their respective data.

User A should only be able to see Sales where Sales.Location = 1

User B should only be able to see Sales where Sales.Location = 2

... and so on.

I believe I've read this is possible, but in looking through the permissions you can define, I've only found where you can limit the columns a user sees, not records.

Anyone have any ideas or did I just remember something wrong?

View 6 Replies View Related

Error Creating First SQL Express Database Via VWD 2005 Express: User Does Not Have Permission To Perform This Action

Aug 18, 2006

I get an error dialog when I try to create a new SQL database, both via the Add New Item dialog and the property wizard of a new SqlDataSource control. The error is:


Local Database File:

User does not have permission to perform this action.

I've searched for help with this.

I ensured the App_Data folder exists and I added the local ASP.NET account to the group that have R/W access to it (although the RO flag is in an unchangeable tri-state on the folder).
The SQL Server Express error log is clean and indicates full functionality.
Everything is running locally.
No VWD installation errors.

Any ideas?

Thank you!

View 3 Replies View Related

Giving Access To User

Apr 8, 2008

Hi All,
I need to give access to one user only to truncate a particular table. I am not able to frame exact query for this. However i can user EM and do it.
But i wanted to know the query for this.


Thanks in advance.
-- Chetan

View 1 Replies View Related

Giving User Permissions Tp Columns

Oct 24, 2006

Hi

I have created a user and given select permissions on a table, I want to go deeper and just give select on a few columns within the table but unable to do so. Can someone tell me how I can do this.

Thanks

View 4 Replies View Related

Giving A User Permissions On Objects In A Schema

Nov 22, 2006

Hi,

SQL Server Security is not my strong point so forgive me for asking stupid questions.

 

I have a bunch of tables and sprocs within a schema 'MySchema'. I have a user 'MyUser' defined in the database.

I would like to give MyUser permission to SELECT from tables and EXECUTE all sprocs in MySchema. What is the simplest way of doing that? Will the following:

GRANT EXECUTE ON SCHEMA::[MySchema] TO [MyUser] WITH GRANT OPTION AS [db_owner]
GRANT SELECT ON SCHEMA::[MySchema] TO [MyUser] WITH GRANT OPTION

accomplish that? (I can't test it out at the moment because our DBA isn't around and I don't have permission)

 

With best practices in mind - is what I am doing here considered "ok". Any suggestions/comments are welcome.

-Jamie

 

P.S. Can anyone recommend any documentation that talks about what best practices should be in the use of schemas. BOL is a bit sparse. Thanks.

 

View 5 Replies View Related

SQL Security :: Giving Access To A User Using DOS-Batch Script

Oct 20, 2015

Is it possible for a batch command to give access or add a new role for the user to database? Basically:

USE my_Database
CREATE USER [User1] FOR LOGIN [User1] WITH DEFAULT_SCHEMA=
[dbo];
EXEC sp_addrolemember 'Application1', 'User1'
EXEC sp_addrolemember 'SQL_Read_Only', 'User1'

If User1 was already created then ignore that and run the exec sp_addrolemember. Next, 

EXEC sys.sp_change_users_login
@Action = 'Update_One',
@UserNamePattern = 'User1',
@LoginName = 'User1',
@Password = NULL

to link the orphan user within database.

View 3 Replies View Related

SQL Security :: How To Copy Permission Of A User To Newly Created User

Oct 24, 2015

How can i assign permissions to a newly created users as of an existing user?

View 3 Replies View Related

Creating A New User For Sp Execution Say Sa (to Whom I Am In Need Of Creating Under My User Defined Db )

Jul 11, 2007

I am in need of creating a new user for stored procedures execution say sa (to whom i am in need of creating under my user defined db)

View 1 Replies View Related

User Permission

May 6, 2007

Hi,

I grant read/update/insert permission on the speicific columns of the table on the users. I want to write the T-SQL to retrieve what permission/column permission does the user have.

View 1 Replies View Related

Set Up User Permission

Mar 13, 2008



Hi,

I am new to reporting service. I set up a couple reports and deployed them to Report Manager. I then add my colleague's Windows user account to the report folder so she can view the reports. When she tried she got Login failed error. I have to go into the SQL database and manually add her account into the Login and assign permission to her for each database or stored procedure involved. Then she can view the reports. We do want to control who can view what reports and later hopefully who can view which part of a report. But do I have to manually give permission to each user account/or group in the SQL server? There got to be a better way to do this I feel. Can we use just one account to talk to the database and let what we set in report manager control who can view what? Thank you very much for your help in advance.

View 5 Replies View Related

Severe Error Occurring When Creating Assembly With External Access Permission

Jul 11, 2006

I had created a CLR function in my db and was able to execute it successfully a couple of months ago. But when I tried to execute it today it was throwing errors saying there was something wrong with the permissions on the assembly. So I decided to drop everything and recreate it except I can not longer create the assembly with EXTERNAL ACCESS permissions. Whenever I try to create the assembly I get the followng error:

Msg 0, Level 11, State 0, Line 0

A severe error occurred on the current command. The results, if any, should be discarded.

Msg 0, Level 20, State 0, Line 0

A severe error occurred on the current command. The results, if any, should be discarded.

I also tried to create the assembly with Unsafe permissions and got the same error. Does anyone know why this error would be occurring now? I tried creating the same assembly on a different SQL 2005 server and it creates successfully and can be executed successfully. Any help would be greatly appreciated!!



Thanks!

GN

View 3 Replies View Related

Analysis :: Creating User Who Can Only Do User Management Activities?

Nov 25, 2015

I would like to limit the role of an user In Visual Studio only to assign roles to other users for the cubes. Other than that the user should not be able to create / delete the exisiting cubes or dimensions.

View 2 Replies View Related

User Permission Needed

Jun 7, 2001

Hi all,

I need to run a query that would return all users with sa privileges at a server level. Sysusers has the db users for each individual databaase. But I need to list all sa users and the databases they have rights to. Looks like I may need a cursor...not sure. If any of you can help me build this query, I would really appreciate it. Thanks.

View 2 Replies View Related

Restoring User Permission

Sep 10, 2000

I have a nightly job that restores a production database to a reporting server. I have some report- related stored procedures
that need to run on the reporting server once the database is restored. However, during the restore, the permissions for the
reporting stored procs get deleted and replaced with the production permissions, which are useless in this case.

Is there a script or system stored procedure I can schedule to run after the nightly restore that will also restore user
permissions? Thanks, Frank.

View 1 Replies View Related

User Permission List

Apr 28, 2006

Hi, Does anyone has a script to get user permissions on all tables?
Thanks

View 8 Replies View Related

How To Grant Permission To User?

Apr 25, 2008

Hi,
I newly created one database (using creat database testdb ). After that i created login name and password for that database ( using create login login1 with password = 'pass1'; use testdb; command) and i created user for that login name ( using create user user1 for login login1 command).
Then i connected testdb database using login1. But when i trying to create table in that database, it thrown error. Anyone please tell me that how to assign all privileges to the user user1?

Sathish kumar D

View 3 Replies View Related

User Does Not Have Permission (error 15247)

Apr 1, 2007

Hi,I have installed sql server 2005 express on a Windows xp system with windows authentification. I did this with my administrator account (dan). When i start sql server management studio, i see: user name: myserverdan .Now i want to create a new login, so i rightclick on 'logins' in 'Security' of 'Database'. I take an existing windows-account, but when i click on OK, i get the error: user does not have permission to perform this action (error 15247).I also tried to delete a login, but same error.Any help would be appreciatedT.

View 2 Replies View Related

User Does Not Have Permission To Perform This Action.?

Aug 2, 2007

I am trying to use a query analyzer to perform a task and I keep getting this message....how do I get around this?

View 1 Replies View Related

Login/User Permission For App Developers

Mar 18, 1999

Hello Everyone,
I need your input. When, if ever, should programmers be given the 'sa' login. The reason that I ask is because a group of three developers have approached me asking for the 'sa' login so they could write stored procedures and do some database level tasks. I am relatively new to data admin and I am under the opinion that I should probably just alias their login to 'dbo' on the one database that they are developing their app for.

What do you guys think about this.

Thanks in Advance,
Terry

View 2 Replies View Related

User (guest) Does Not Have Permission To Run DBCC

Jan 15, 2015

I try to attach a database mdf file to Microsoft SQL server 2014 on Amazon Elastic Computing Cloud, EC2, but fail with the following message, "User 'guest' does not have permission to run DBCC checkprimaryfile. (Microsoft SQL Server, Error: 2571)" The ID I use to REMOTE login has administrator rights and I have chosen to "run as administrator"

View 1 Replies View Related

Script To Generated The User And Permission

Oct 3, 2005

Here is the simple script, which generated the user and user permission and can be transferred to another database. I think it may useful for new DBA. I just wrote it 2 days ago.

-----------------------------------------------------------------



declare @login varchar(20),
@db_user varchar(20),
@role varchar(30),
@role_mem varchar(30)

print 'USE '+ db_name()
print '-------------------------------------------------------------'
print '--Granting current DB access'
print '-------------------------------------------------------------'
declare add_user cursor for
select b.name as 'login', a.name as 'db_user' from sysusers as a inner join master..syslogins as b
on a.sid = b.sid and b.name <> 'sa' order by a.name,b.name
open add_user
fetch next from add_user
into @login, @db_user
while @@fetch_status = 0
begin
print 'exec sp_grantdbaccess '+''''+@login+''''+','+''''+@db_user+''''
fetch next from add_user
into @login, @db_user
end
close add_user
deallocate add_user
print '-------------------------------------------------------------'
print'--Adding role'
print '-------------------------------------------------------------'
---------add role
declare add_role cursor for
select name from sysusers where issqlrole =1 and gid <> 0
open add_role
fetch next from add_role
into @role
while @@fetch_status = 0
begin
print 'exec sp_addrole '+''''+@role+''''
fetch next from add_role into @role
end
close add_role
deallocate add_role
----------add role members
print '-------------------------------------------------------------'
print '--Adding role members'
print '-------------------------------------------------------------'
declare add_role_member cursor for
select g.name as 'role',u.name as 'name'from sysusers u, sysusers g, sysmembers m
where g.uid = m.groupuid and g.issqlrole = 1 and u.uid = m.memberuid and u.name <> 'dbo' order by g.name,u.name
open add_role_member
fetch next from add_role_member
into @role_mem,@db_user
while @@fetch_status = 0
begin
print 'exec sp_addrolemember '+''''+@role_mem+''''+','+''''+@db_user+''''
fetch next from add_role_member
into @role_mem, @db_user
end
close add_role_member
deallocate add_role_member




Sanjeev shrestha

View 1 Replies View Related

The User Does Not Have Permission To Perform This Action.

Sep 14, 2006

hi,I am getting the following error while trying to add a remote server.The user does not have permission to perform this action.The command i used is:exec sp_addlinkedserver 'remote_server_name'What is the solution?Regards,Kalaivanan.

View 1 Replies View Related

The User Does Not Have Permission To Perform This Action

Jul 19, 2007

Hi All



I kind of hit the wall with this message.

Here is what I do:

select * from sys.dm_db_index_physical_stats(24,null,null, null, null)

My server is 64 bit 2005, sp2.



That's the message I get.

I am loging int as Administrator.

Does anybody know what needs to be done?

View 4 Replies View Related

Permission For Linked Server User

Aug 30, 2007

Dear,

What minimum permission do i need to grant to a Remote Login to create a linked server.

Regards
Sufian

View 7 Replies View Related

User Does Not Have Permission To Perform This Action. Problem

Jan 31, 2007

hey people having a nightmare getting asp.net 2.0 to work with sql server 2005 express, bit of a newbie with it. trying to display a table from my sql database and every time i run the aspx table im getting this error.  User does not have permission to perform this action.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: User does not have permission to perform this action.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SqlException (0x80131904): User does not have permission to perform this action.]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +734995
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838
System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +33
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +628
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +130
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +496
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
System.Data.SqlClient.SqlConnection.Open() +111
System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +121
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +137
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83
System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1770
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +17
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
System.Web.UI.WebControls.GridView.DataBind() +4
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +69
System.Web.UI.Control.EnsureChildControls() +87
System.Web.UI.Control.PreRenderRecursiveInternal() +41
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360 keep getting the user permission error, even though it says on the management console that i have access to the database any ideas?  rob    

View 3 Replies View Related

How To Grant Sysadmin Permission To SQL Server User ?

Jul 26, 2001

Hi,

I'm trying to run the Bulk Insert statement but in order for me the run it, i need to have the sysadmin permission. Can someone show me how to grant sysadmin permission to my SQL Server user? This is really urgent. Thank you in advance.

View 1 Replies View Related

Getting Permission For User Sa On SQL Server Express 2005

Oct 16, 2007

I originally installed SQL Server Express 2005 on my computer using Windows Authentication mode, and discovered when I tried to add another user/login that I didn't have permission to do so. This is rather odd as the windows account that I installed SQL server with is the system admin for the computer.

I have successfully changed the login mode to mixed, and have tried to login in as "sa", but it appears that "sa" was given some sort of password (did SQL server automatically generate one?), and I don't know what it is. When I go into command prompt and try to change the password, it says that it cannot alter the login 'sa' because it does not exist or I do not have permission (i'm pretty sure it's the later, as 'sa' shows up on the list of logins in SQL server express).

I'm so stuck! Please help!

View 6 Replies View Related

How To Grant User Permission To Create Other Users?

Jun 26, 2007

There's something I can't quite figure out about user creating



The application that I'm currently working on is interacting with DB, therefore every time you use application you need to login as user which is fine. The problem is that certain users should be able to create new users and the new user may even have the same level of permissions as the one that's creating it ( like admin creating another admin acount or some like that).



Question is how can I allow users to create these user with giving them as few permissions as possible.



If there's is somewhere a code sample on the net I would appreciate the link.







View 1 Replies View Related

Error:User Does Not Have Permission To Perfor This Action.

Feb 7, 2006

I just installled the Visual web developer - express addition. When I try to add aSQL database to my project it gives the following error - "User does not have permission to perfor this action" . Can someone please help?

View 4 Replies View Related







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