Get List Of Users Not In A Specific Role

May 30, 2008

ere is the make-up of the tables:

[dbo].[PortalUser](
[PortalUserID] [bigint] IDENTITY(1,1) NOT NULL,

...

[dbo].[Role](
[RoleID] [bigint] IDENTITY(1,1) NOT NULL,
[Name] [nvarchar](250) NOT NULL,
[IsActive] [bit] NOT NULL CONSTRAINT [DF_Roles_IsActive] DEFAULT ((1))
...

[dbo].[PortalUserRole](
[PortalUserRoleID] [bigint] IDENTITY(1,1) NOT NULL,
[PortalUserID] [bigint] NOT NULL,
[RoleID] [bigint] NOT NULL,
[IsActive] [bit] NOT NULL CONSTRAINT [DF_PortalUserRole_IsActive] DEFAULT ((1))

I'm asking to get a list of portalUsers that do not have a PortalUserRole records for the rolename I'm checking against. And don't ask me why the person who coded this is searching on rolename not ID. But this is how we're doing it for now.

View 6 Replies


ADVERTISEMENT

Stored Procedure To Get All Users Or All Users Of A Specific Country

Apr 30, 2008

hi alli've got two tables called "webusers" (id, name, fk_country) and "countries" (id, name)
at the meantime, i've a search-page where i can fill a form to search users. in the dropdown to select the country i included an option which is called "all countries".
now the problem is: how can i make a stored procedure that makes a restriction to the fk_country depending on the submitted fk_country parameter?it should be something like
SELECT * FROM webusers(if @fk_country > 0, which is the value for "all countries"){    WHERE fk_country = @fk_country}
who has an idea how to solve this problem?

View 9 Replies View Related

Assign Specific Data To Specific Users

Mar 21, 2008

I am very early on in developing a website to track issues with projects which is tied to a SQL database.  I have my Projects Table, my Users Table, and am creating a third table to track issues.  I'm wondering what is the best way to assign specific users to specific data/projects.  The user should only be able to view & update the projects assigned to him.  He should not be able to see other projects.  What is the best way to assign projects/data to the users to make sure they are only viewing their data?

View 1 Replies View Related

Analysis :: Scope Statement For A Specific Role

Nov 2, 2015

Just wanted to know is there any way to write scope statements only for a specific role in the cube.

View 3 Replies View Related

New Role And Users Creations

Apr 9, 2008



Hello,
We have 700+ databases on SQL server 2005, and we constantly adding more db.. I know, this is not the best... I have the same group of people who needs to have identical permissions on all existing and newly created databases... How can I acchieve that in efficient way? Ideally I would like to create new database role which has read and write access to all objects in all databases, and add users to this new role. Do those users need to be added to each database? How can I assure that new database will have role and users already added after the creation? Can I add it to the model and all other dbs will have it?

View 1 Replies View Related

Sql DB BuiltInPower Users Role

Aug 18, 2006

I want to programmatically, using C#, provide BuiltInPower Users permission to a database. That is, I want any user who is logged into the computer where they belong to the Windows Power Users group to be able to log into Sql Server and to a database. I am able to do this nicely in the English version of Windows XP and Sql; however, the same procedure, for example, in the German version fails due to a change in spelling of 'Power Users' in german. In C# one is able to use the enum WindowsBuiltInRole.PowerUser which helps application specific permission issues, but how does one do this when using international XP versions connecting to Sql server. That is, how does one establish BuiltInPower Users permissions for SQL when using international versions of the operating system. Or maybe I am approaching this the wrong way.

View 1 Replies View Related

Kill Users Without Processadmin Role

Nov 19, 2004

Hi folks, i create a procedure in master db that kill users spids. Giving EXECUTE permission on the procedure to users without giving processadmin role doesn't work! Any guidelines?



Howdy!

View 3 Replies View Related

Adding Users To A Role In Bulk

Feb 23, 2004

I have a need to add all the users listed in the sysxlogins table to the db_datawriter role. I wrote a proc that does this. It indicates that each user is successfully added to the role, but they aren't. If I look at the user in EM, they don't have that role checked. I've tried all the obvious stuff like close EM and re-open, etc...it doesn't help.

Here is the proc
CREATE proc sp_MyProc
@DBName varchar(256)
As

Declare UID_Cursor Cursor
For
Select Name from master..sysxlogins Where Len(Name) = 7 Order By Name

Open UID_Cursor
Declare @Name as varchar(256)
Declare @TempString as varchar(8000)

Fetch Next from UID_Cursor into @Name


While (@@Fetch_Status <> -1)
Begin

Set @TempString = 'sp_addrolemember ''db_datareader'', ''' + @Name + ''''
Exec(@TempString)

Fetch Next from UID_Cursor Into @Name
End

Close UID_Cursor
Deallocate UID_Cursor

View 4 Replies View Related

Who Cand Add Users To The Db_securityadmin Role ?

Jul 28, 2006

I have user which is a member of the db_securityadmin database role. It has no other permissions applied to it. When I login with this user, and try to add some other database users to the db_securityadmin role, I receive an error stating that I don't have the permissions to do this:

User does not have permission to perform this action. (Microsoft SQL Server, Error: 15247)

Is this the normal behaviour, or is there something wrong ? I am using SQL Server 2005. From what I know, this works fine with SQL Server 2000, but it doesn't work as I expected with SQL Server 2005.


View 6 Replies View Related

List Users Then Disconnect Users

Jun 4, 2008

I want to be able to list all users connected/logged in a specific database and disconnect them all or a certain user.

can this be done in SQL and if so how?

View 1 Replies View Related

How Can One User View Other Users That Belong To A Database Role?

Nov 15, 2006

After upgrading my database from SQL2000 to SQL2005 I have noticed a change in behavior of sp_helprolemember.

In SQL2000 I could connect as 'user1' and use sp_helprolemember to find all users that belong to a certain role.

In SQL2005 sp_helprolemember seems to only show me the roles that connected user belongs to. For example, if I connect as 'user1' I only see the roles that 'user1' belongs to.

Any advice on how to duplicate the behavior from SQL2000?

View 8 Replies View Related

Accessing Windows Users Assigned To A Database Role

Mar 3, 2006

Is
there a way to find a list of Windows User accounts that are directly
or indirectly (through Windows Group membership) assigned to a database
role?


I could put work in to CLR programming or using a Linked Server to
Active Directory, but if there is a sys.* view available that can
provide me this
information directly it would be much easier.



I'll be looking into this further myself anyway and posting an answer
if I can find one, but if anyone has suggestions... well, thanks!

View 1 Replies View Related

Server Level Role That Can Add / Alter Logins And Corresponding Users On All Databases

Jul 7, 2015

Does securityadmin Server level role can add, alter logins and corresponding users on all databases ? 

If not what is the best role other thn SA to have to manager logins and users.

View 4 Replies View Related

Advice On Security Model For XML Web Services For Many Users In Active Directory Role

Feb 21, 2006

I am working on the security model for an application that will be used by 100s of users with a dedicated SQL 2005 database for this application and access via SQL XML Web Services.

The client has asked to make it "open" during alpha testing such that anyone can access the web services without having to set them up first. Is there a way to do this? The best I can figure is to use mixed mode security and hard code a login and password. Any method using Windows authentication would require that I add every user at a minimum to the database.

In production, all users will have an active directory role specified that determines if they should have access to the web services or not. However, it is my understanding that to use Windows authentication, I would still need to add each individual user at a minimum as a Login to the SQL Server, and under best practices also as database users with permissions granted to the endpoint.

Am I correct in the above, or is there a more efficient way to achieve these results?

Thanks

-L

View 1 Replies View Related

Setup And Upgrade :: Users With Sysadmin Role Can't Access Network Drives

Oct 12, 2015

When I create logins for SQL Server 2012, something strange happens. When I assign the sysadmin role to a login, the login loses the access to the network drives (for example when creating or attaching databases). The only possible place is the c:drive of the computer that is running SQL Server.

View 11 Replies View Related

Giving Users Specific DDL Permissions

Jul 20, 2005

I have an archival process on a large database that runs once a month.At the beginning of the process the triggers and indexes on thetables whose data is moved are dropped, the data is moved and then thetriggers and indexes are recreated at the end. This produces amassive improvement in performance.The problem is the process is supposed to run on users accounts (thatsthe way the front-end is set up) and they don't have the neccessarypermissions to drop & create triggers & indexes. I can't see any wayto give them permissions only on specific tables or triggers/indexes.Nor does giving them permissions to the stored procedures that do thedropping & re-creating work, DDL permissions don't seem to beinherited the way they are with tables.Is blanket rights to drop & create objects through the db_ddladminrole the only way users can get rights?Thanks,K Finegan

View 2 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

Return Users Who Do Not Have A Specific Reference ID In A Many To Many Relationship

Oct 31, 2006

Hello, I was wondering if someone could point me in the right direction on how to do this....I have a table that is a many to many relationship between userID's and courseID's.  for instance (example data for each row - dont let the spaces between rows throw you off I am just adding them to seperate the different users)userID = 1, courseID = 1userID = 1, courseID = 2userID = 1, courseID = 3userID = 2, courseID = 1userID = 2, courseID = 3userID = 3, courseID = 1userID = 3, courseID = 2userID = 3, courseID = 3I want to be able to check for a number so in this case "2" which I would like to return all users who do not have a courseID = 2. In the example above the query would return the user with the userID of 2.Any help in how I should go about doing this would be greatly appreciated. Is there a function I can use? I apologize I am extremely new to SQL

View 2 Replies View Related

How To Create Logs Of Users And The Specific Transaction He Made?

Mar 4, 2008

hi..i need help on how to create user logs with a specific transaction he made. for example, he added new item in the database, the grid wud contain user id, date, time and transaction. help po.. tnx!

View 6 Replies View Related

Transact SQL :: Database Audit Specification On Specific Users

Mar 30, 2015

Currently I am using SQL server 2012 and would like to implement database audit specification on specific users in my database. These are the users in my database name Payroll :-

PayrollAndy.Bred - db_owner
PayrollArpit.Shah - db_owner
Payrollwebapp - db_datareader, db_datawriter, EXECUTE
web_payroll - db_datareader, db_datawriter, EXECUTE

In my database audit specification settings, I would like to capture any SELECT,UPDATE,DELETE and EXECUTE command for users PayrollAndy.Bred & PayrollArpit.Shah only since they owned db_owner access. However, I am unable to capture any single command from both users. I do not want to put 'Principal' as public since I just want to capture both users activity.

Is it I miss out anything? Is it because of windows login account?

View 2 Replies View Related

Navigation From The Root Folder To Specific Folders For Users

Apr 1, 2008

Hi there, I have the following setup in the report manager:

Root
|_ Sales
|_ Sales Export
|_ Marketing
|_ Production
|_ etc...

Now, I know that I can access each folder (f.e. Sales) by directly putting it into the URL. Is there a possibility to enable every user to the root folder and then denying access on specific folders? F.e.: Our Head of Sales should be able to navigate to the root folder and then dcecide whether he wants to enter the Sales or the Sales Export folder.

Is this possible? I tried a few things, but nothing works.

Thanks in advance!

View 5 Replies View Related

SSRS How To Customize The Report Models Created For Specific Users

Jan 3, 2008

hi,

I am new to SSRS. I am doing some report models for Ad-hoc reports. Im my database i have some users and their roles according to my requirement. User should only see the particular reports if he have privilege. how to customize...

User will access Report Builder to do adhoc report.

For example
I have 5 report Models
rptModel1
rptModel2
rptModel3
rptModel4
rptModel5

In my data base there are 3 users.
user1 have privilege to view rptModel1, rptModel3
user2 have privilege to view rptModel4, rptModel5
user3 have privilege to view rptModel2, rptModel5

When Particular user access the report builder, There i want to show only that particular Report models...
is there any posibilities to do this please Help me.

Thanks in Advance...


-Kannan
kannan1017@gmail.com

View 5 Replies View Related

Getting Database Specific Table List From ADO

Aug 21, 2000

We are listing available SQL databases for selection in a VB list box, but need to be able to then elicit the tables in the database for another list. I am sure it is something simple, could someone help me out with this? Thanks!!
Laura

View 1 Replies View Related

List Of Users From Different Dbs

Jan 21, 2007

I am trying to get list of users on different dbs located on different servers.Currently i get them manualy by going on each db and copy the users to excel sheet.I tried to use sysusers, but i needed status of their account, created . Is there any easy way where i can pull list of users from all dbs from at once.I also need to exclude dbo accounts ans sa accounts if possible

View 1 Replies View Related

List Of Users?

Feb 14, 2005

How can i get a list of user that have access to all my databases?


i know how to view them but i need to output them to a text file or excel.

View 2 Replies View Related

Getting A List Of Users

Apr 4, 2008

Say I had a "typical" user table such as:

USerTable
---------
enduserid
user_name
password
firstname
lastname
...

Say this table grows very large, what would be a good way to fetch a list of users that was configurable to bring back all or some of the users ? How about a procedure that uses a range of user id's. So if you wanted ALL of you users, you just use a range of inputs that span the entire range.

comments ?


CREATE PROCEDURE EndUsers_Select
@lowuser int,
@highuser int

AS


SELECT
eu.FirstName
,eu.LastName
,ci.Email
FROM UserTable eu
JOIN ContactInformation ci ON eu.ContactInformationID = ci.ContactInformationID
WHERE EndUserID < @highuser AND EndUserID > @lowuser

View 2 Replies View Related

Reporting Services 2005 - Giving Access To All AD-users For A Specific Folder

Jan 21, 2008

I am in a project where we are using a vanillla Reporting Services 2005 with the builtin report portal. No sharepoint integration yet.

We have successful deployments where we limit access to different folders based on AD-accounts and groups. In this particular case I have a folder for which I would like to allow access to all AD-users within the entire company.


So basically I know how to limit access but I don't know how to enable access for everyone. Is there a simple way to do it? I have googled and search mshelp but I couldn't find anything. I will admit to the search being quite quick but as usual time is short.

View 1 Replies View Related

MSSQL 2005 Inserting Data On Tables Created By Regular Users With Ddl_admin Role, Using Access Or Other Front End Apps

Feb 14, 2008

Writing to tables created by regular users on MSSQL2005

I have users creating tables through an application, I gave them ddl_admin, datareader, datawriter. They can create tables but cannot insert/update data (to their own tables), I cannot insert data either using Access or any other application to those tables created by them (under dbo schema) Is there something I am missing with permissions? Thank you very much

View 3 Replies View Related

How To Default Drop Down List To A Specific Value In Database

Oct 21, 2014

I have a drop down list that is populated by a stored procedure which has two int parameters (ID, STATUS). I need to default the drop down list to a value in the database that is associated to the ID & STATUS parameters.

The problem I am having is that it only works if the selected value is the first record on the drop down list. for any other records (outside the first record) from the drop down list i get "The 'SelectedIndex' and 'SelectedValue' attributes are mutually exclusive."

Here is the stored procedure I am using to populate the drop down list:

ALTER PROCEDURE [dbo].[usp_SelectName]
(
@pId Int,
@pStatus Int
)
AS
BEGIN
IF @pId = -1 --THIS VALUE IS USED AS DEFAULT (NOT POSTBACK)

[Code] ....

Here is the TABLE_NAMES that holds the data for the drop down list:

IN_ID IN_NAMESTATUS
6 New 0
4 Generic 0
3 Local 1
4 Storm 0

This is the TABLE_2 that holds the complete collected FORM data that has the selected record IN_ID from the TABLE_NAME:

ID STATUS IN_ID
111906
114406
114505
114606
114706

View 4 Replies View Related

How To Find Out List Of Users

Aug 4, 2015

Also , is it true that Grants to service accounts should go through roles as it is against audit & compliance standards? If yes, than how to find out the list of users who has direct grant to a service account ?

- Then how to revoke this grant from service account and than how to grant through the role ?
- Is there a script that i can run and find the list of users in each SQL server instance ?

View 0 Replies View Related

List Of SQL Server Users

Jul 23, 2005

Is there any method by which i can get the list of all sql server users?

View 1 Replies View Related

List Of Connected Users

Mar 7, 2008

sorry about asking basic question, just slipped out of my mind,
how to get the list of currently connected users on one database and on whole server in sql server 2005

thanks,

View 9 Replies View Related

Get List Of All The Databases Hooked Up To A Specific Login Name Created

Jun 7, 2007

Hi



I have created a new login in SQL Server 2000.

I have hooked up to more than one database which creating the login.



In syslogins we can see only the default database associated with that login.



I want the list of all the databases for that specific login..



How could I get them?

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

My main task is to create a login under a specific database.

For which I'm validating whether that login already exists or not I'm checking it in the syslogins table. I need to specifically check it is in my databse or not....for that what should I do...



Thanks in advance

View 4 Replies View Related







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