Query to Check DatabaseMailUserRole Permission To A Login

Hi Friends,
Is there any query to find to find weather the login has already granted DatabaseMailUserRole permission ?
Example, I am adding a user to msdb and  need to grant the DatabaseMailUserRole permission but before granting need to verify weather it has already granted.
Regards, Pradyothana DP. Please Mark This As Answer if it solved your issue. Please Mark This As Helpful if it helps to solve your issue. ========================================================== http://www.dbainhouse.blogspot.in/

Hi
Try these
use msdb
go
sp_helprolemember 'DatabaseMailUserRole'
You can also use is_rolemember -
Use IS_ROLEMEMBER to determine whether the current user can perform an action that requires the database role's permissions.
http://msdn.microsoft.com/en-us/library/ee677633.aspx
Another query
select DRP.role_principal_id , DPP.name as ParentRoleName,DRP.member_principal_id , member.name as MemberRoleName
from sys.database_role_members DRP
inner join sys.database_principals DPP
ON DRP.role_principal_id = DPP.principal_id
inner join ( select DP.name,DRM.member_principal_id from
sys.database_principals DP inner join sys.database_role_members DRM
ON DRM.member_principal_id = DP.principal_id
) member
on DRP.member_principal_id =member.member_principal_id
where DPP.type ='R'
and DRP.role_principal_id = (select principal_id from sys.database_principals where name = 'DatabaseMailUserRole')
Regards, Ashwin Menon My Blog - http:\\sqllearnings.com

Similar Messages

  • How to display first row value returened from a query as checked as default in a report

    How to display first row value returned from a query as checked as default in a report
    Example
    Parameter 1
    Paramerter2
    ABD
    x(checked)
    Test
    DEF
    JMG
    Mudassar

    Hi Mudassar,
    The issue is caused by the order in which the parameters appear in the report data tab can be difference between our report execution and it failing. In other words, “Parameter2” is execution before parameter “A” due to this issue. We can adjust the parameter’s
    order to solve the issue.
    If “Parameter2” is parameter “A”, we cannot use that expression. Because fields cannot be used in report parameter expression, if we want to display the first value returned from a query as default value, we have to fill the “Specify values” text box with
    the specific value in Default Values dialog box.
    Regards,
    Alisa Tang
    Alisa Tang
    TechNet Community Support

  • I purchased a IMac in Feb later I added a Seagate ext. hard drive. On April 29 I received an errors that the ext. Drive may be a read only and not backing up files. I'm unable to check disk permission or correct errors. Help would be appreciated.

    I purchased a IMac in Feb later I added a Seagate ext. hard drive. On April 29 I received an errors that the ext. Drive may be a read only and not backing up files. I'm unable to check disk permission or correct errors. Help would be appreciated.

    Click on the hard drive on the desktop, then File > Get Info. What does it say about permissions?  If this is just a data drive you may want to consider "ignore ownership on this volume".
    Otherwise I can only say I have not been reading good things about Seagate drives recently.  I have some of their rock-solid ones from about 10 years ago (still running well), but now...?

  • Query to check BP Payment terms and Document Payment terms

    Hi All,
    Can any one help me to create an approval query to check the BP payment terms and Document Payment terms are same or not?
    Normally we change our BP payment terms regularly as per the agreements between Customer and us.
    but when we copy any previous document into invoice it calculate the Due date as per previous payment terms. so we need an query to check wether the BP payment terms and document Payment terms are same or not? if it is different they it should ask for authorization from manager or else the document should be saved.
    Thanks in Advance,
    Prachi.

    Hi
    I will test this and will let you know if it works or not?
    Thank you very much.
    Prachi.

  • Server does not return query metadata check the query

    hi,
    i want know how to  use bex query designer,
    when i  insert a data provider,the message is appear "server does not return query metadata check the query",
    who can help me ?
    thanks a lot !
    addition: my current entironment is: gui710 with sp4,bi710 with sp2.

    Hi,
    All the yellow and red lights will have an effect on query performance or execution.  Read up on them as there are too many to explain via this forum.
    There is a document on SDN on query performance.  Some useful links:
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/9f4a452b-0301-0010-8ca6-ef25a095834a]
    [http://help.sap.com/saphelp_nw70/helpdata/en/41/b987eb1443534ba78a793f4beed9d5/frameset.htm]
    [http://help.sap.com/saphelp_nw70/helpdata/en/d9/31363dc992752de10000000a114084/frameset.htm]
    [http://help.sap.com/saphelp_nw04/helpdata/en/2e/caceae8dd08e48a63c2da60c8ffa5e/frameset.htm]
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e0501cb9-d51c-2a10-239c-c141a22c45a6]
    Cheers...

  • Explain Plan understand technique & Query optimizing check list

    Hello gurus,
    Can some body help me with doc available or your experience to tell on how to understand Explain Plan & Query optimizing check list.
    Thanks..

    That's correct,
    But unfortunately the institute is pretty far from home.. and travelling time will be high..
    I am a working man..
    Please suggest if some good book or link.
    Thanks.

  • Checking user permission doubt

    Hi everyone,
    I have posted a question yesterday, but I have no right answer. I want to try again, please help me. It is urgent! I thank in advance.
    I am developing a recursive tree in a Web Dynpro App. My tree has some nodes and sub nodes. Under the sub nodes I have documents. These documents are composed of header, footer, address, content and so on, which are loaded in runtime from Backend system. There is possible that thousand documents can be attached to a node. For accessing the documents we need to check the permission of the user. There are users who may read the whole content of a document. There are users who may only read parts of the document. For example, the information about salary of an employee shouldn't be read by every user. How can I check the user permission? Has someone any Suggestion?
    Regards,
    Hairong

    Hi William,
    thank you very much for your answer.
    I haven't worked with ACL. With your answer, I hava read something about ACL. It is used for checking user permissions for accessing portal content.We have no portal now. Our application is standalone application. Do you know what is a connection between reqular UME permission and UME ACL permission?
    By the way, we use UME to store our user profile. We have already tried to check user permission only for UME role of the user. We have also tried to follow the concept like the Web Dynpro tutorial RentCar APP with Actions and permissions. But all these can't resolve our problem really, because we can't create for every document a role or a permisson.
    here, ich want also to thank Atul who had me an answer to my question.
    Best regards,
    Hairong

  • Check user permission level using jquery/javascript

    On a sharepoint page I need to check permission level for a user and based on permission level he is having i need to hide few elements on that page.any pointers on how to check user permission level using jquery/javascript.
    for eg: i need to do something like this
    if(userpermissionlevel=="custom read"){//hide some elements}
    Any pointers will be helpful.

    Try below
    function checkifUserHasEditPermissions()
    context = new SP.ClientContext.get_current();
    web = context.get_web();
    this._currentUser = web.get_currentUser();
    context.load(this._currentUser);
    context.load(web,'EffectiveBasePermissions');
    context.executeQueryAsync(Function.createDelegate(this, this.onSuccessMethod), Function.createDelegate(this, this.onFailureMethod));
    function onSuccessMethod(sender, args)
    if (web.get_effectiveBasePermissions().has(SP.PermissionKind.editListItems))
    //User Has Edit Permissions
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/f21ad6b1-445a-497d-a286-d3ba8c2928a6/how-to-get-the-current-user-permission-level-on-a-list-item-with-ecmascript
    or
    http://stackoverflow.com/questions/22122139/check-if-current-users-belongs-to-sp-group-using-javascript-client-side-object-m
    http://blog.fidelityfactory.com/2011/11/29/sharepoint-client-ecma-script-check-user-permissions/

  • Query to check cross segment postings

    Hi,
    I have a database with a segmented chart of accounts. It has only 1 segment for the company. The client would like to have the ability to post across segments however I need to ensure that the journal is always balanced overall, but aswell as with a specific segment.
    I would like to create a SQL query to check all my journal entries to determine weather the journal is balanced on all segments...
    Any ideas?
    Grant
    Edited by: Darius Heydarian on Mar 27, 2008 2:06 PM

    Hi Suda,
    I have a journal as follows:
    Account Code--Debit--
    Credit
    720002-002--2000--
    720002-003--1000--
    720001-001----
    3000
    201201-001--3000--
    201201-002----
    2000
    201201-003----
    1000
    In the above example you will notice that the journal is balanced, and the debits and credits between each segment is also balanced. This transaction is therefore acceptable.
    If the journal is balanced, but the debits and credits for a specific segment are not in balance then the transaction is not acceptable.
    I need a way to either block these type of journals or alternatively to provide a report to highlight the "incorrect" journals...
    Hope hope this makes my requirement a little clearer...
    Regards
    Grant
    Edited by: Grant Boshard on Mar 13, 2008 1:55 PM

  • Query to Check whether balancing segment value is assign to ledger

    Hello All,
    I am getting above error while running the Journal Import.
    Can any send me the query to check this details from Backend.
    Your help is appreciated.
    Thanks,
    AB
    Edited by: ABA on Jan 6, 2010 6:23 AM

    Here is the query to check balancing segment value Assigned to ledger or not.
    select ledger_id,segment_value balancing_segment,legal_entity_id
    from GL_LEDGER_NORM_SEG_VALS where segment_type_code = 'B'
    Thanks,
    AB

  • Query regarding Check Printing

    Hi All,
    I have a query regarding check Printing.
    Once I am printing the Check with Transaction FBZ5, the roller of the printer is not being stopped after the printing of first check and four to five checks are coming out.But I want one check will print in the first print command and marker should come onto the edge of second check.
    please suggest how we can do it..
    Thanks,
    Rajeev

    Hi!
    Make a runtime analysis (SE30) and try to find the slow parts. Maybe there is not much help, because it's also possible that the printer needs so much time to convert the data.
    Regards,
    Christian

  • I want SQL query to check if any of our important concurrent programs

    I want a sql query to check if any of our important concurrent programs are currently scheduled or not

    SinghP wrote:
    I want a sql query to check if any of our important concurrent programs are currently scheduled or notThat's nice,
    What scheduling tool are you using? are you referring to dbms_job?
    what version of Oracle are you using? are you using some custom job management system that involves writing to user created tables in your database?

  • Query on Checks deposited for the day

    Hi Experts,
    Can I have a query on checks which were deposited on-date. Columns would be: Dep No. Customer code, Customer Name, Check date, Check No., Bank code and Amount. Parameter would be the Deposit date.
    Many thanks.
    Don

    Hello Don - maybe try this out to see if it works...Regards, Zal
    SQL G BK Daily Check Deposit Report Detail by Date Range Ver 2 ZP 2009 01 20
    --DESCRIPTION:  SQL reports on deposit, incoming payment, check numbers, and customer invoice information.  This SQL is the basis for the Daily Deposit Report Summary by Date Range.
    --AUTHOR(s):
    --Version 1 Zal Parchem 12 Jan 2009
    --Version 2 Zal Parchem 20 Jan 2009 Added Bank Code
    --PROBLEM(s):
    --[P1] ZP 2008 11 18 - SAP does not have a direct link to provide all of the information.  See how SQL places info together in the JOIN statements before making any changes.
    SELECT
    T0.[DeposDate] AS 'Deposit Date',
    T3.CardName AS 'Vendor/Customer Name',
    T3.CardCode AS 'Vendor/Customer Number',
    T1.CheckNum As 'Check Number',
    T3.DocNum AS 'Inv/Cred Memo',
    CASE
    WHEN (T2.InvType = 14)
        THEN (T2.SumApplied * -1)
    ELSE (T2.SumApplied *1)
        END AS 'Sum Applied to',
    T1.[DpstAbs] AS 'Deposit Number',
    T1.BankCode AS u2018Bank Codeu2019
    --T2.DocNum AS 'Inc Payment',
    --T0.[DeposNum] AS 'Filter Number'
    FROM ODPS T0
    INNER JOIN OCHH T1
    ON T0.DeposId = T1.DpstAbs
    LEFT OUTER JOIN RCT2 T2
    ON T1.RcptNum = T2.DocNum
    LEFT OUTER JOIN OINV T3
    ON T2.DocEntry = T3.DocEntry
    WHERE T0.DeposDate >= '[%0]'
    AND T0.DeposDate <= '[%1]'
    ORDER BY T3.CardName

  • Sometimes when I try to sign in, I get a Forbidden, you don't have permission to access login on this server

    Sometimes, not all the time, I get a message that says
    Forbidden
    you do not have permission to access login on this server
    It does not happen all the time, but it happened today about 5 times. I finally had to use Safari to get online and get back to Firefox.
    I never know when I shut down if it will happen when I reboot and try to get online again. This morning was particularly distressing, since it used to happen once, and then I would quit and restart Firefox and it worked. Today it did not work. What can I do to fix this? Thank you

    You can reload web page(s) and bypass the cache to refresh possibly outdated or corrupted files.
    *Hold down the Shift key and left-click the Reload button
    *Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
    *Press "Command + Shift + R" (Mac)
    Clear the cache and cookies only from websites that cause problems.
    "Clear the Cache":
    *Firefox > Preferences > Advanced > Network > Cached Web Content: "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Firefox > Preferences > Privacy > "Use custom settings for history" > Cookies: "Show Cookies"

  • Sql query to grant TRUNCATE permission to a table

    Need help to write sql query to grant TRUNCATE permission to a table

    sujnan wrote:
    Need help to write sql query to grant TRUNCATE permission to a tableThis would require DROP ANY TABLE privilege.
    However, this is a rather powerful privilege and should not be granted to non admin users.
    Alternatively you can create a stored procedure in table owner's schema which would truncate specified table.
    Grant execute rights on this SP only to required users.
    See an example below:
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1458414958491
    You could(rather should) put in more validations in this SP to prevent users from truncating tables that they are not supposed to.

Maybe you are looking for