How to identify "special principal" in sys catalogs

Is there a property to which can be used to identify "special principals" in sys catalogs?
I have trouble deploying databases using visual studio database edition with msbuild.
Somehow, objects gets created in the middle of deployment which alter the design and prevent crash deployment.
The solution I found is to remove access to db users to prevent the creation of those objects during the deployment.
Using the following query:
select rolep.name, memp.name from sys.database_role_members rm
JOIN sys.database_principals rolep ON rm.role_principal_id = rolep.principal_id
JOIN sys.database_principals memp ON rm.member_principal_id = memp.principal_id
I can extract all users and then generate calls to sp_droprolemember to remove their access.
Of course, this does not work for the user "dbo" which yields the error
"Msg 15405, Level 11, State 1, Procedure sp_droprolemember, Line 76
Cannot use the special principal 'dbo'."
Aside of relying on the role names, Is there a property which can be used to identify "Special principals"?

You would need to adapt your code to the situation. In many cases, you need to exclude dbo. If you want to drop logins in general, you can use the type column in sys.database_principals, so that you don't attempt to drop logins tied to certificates.
(Unless you want drop them that is.) You should probably also keep principals of which the name start with ##, as they are various built-ins.
Erland Sommarskog, SQL Server MVP, [email protected]

Similar Messages

  • How to identify rman backup level?

    Hi,
    I am using rman catalog for rman backup. how to identify rman backup level from catalog.
    Thanks,

    By doing the obvious and consulting the online documentation at http://tahiti.oracle.com
    You will notice the list backup command output has a level column and this is also present in rc_backupset and/or rc_backuppiece.
    Sybrand Bakker
    Senior Oracle DBA

  • How to identify what are all the events are created in background jobs?

    Hi all,
    how to identify what are all the events are created for  background jobs. And what events gets triggered for a particular job.
    thanxs
    haritha

    Hi Haritha,
    JOB is a program which starts to a determined point of time and executes some standard programs in the system. JOBs can be planed to a determined point of time on the regular basis (every night, for example) or to some discret time moments. So, the JOB can be planed and then will be started automatically without the manual start.
    Realtime programs are understood in the most cases as actual program execution which is started by somebody to the actual moment of time.
    Typically per JOBs some special processes will be started that should be executed automatically and regularly: for example, IDOC application, some correction reports, statistic updates etc.
    Standard jobs are those background jobs that should be run regularly in a production SAP System These jobs are usually jobs that clean up parts of the system, such as by deleting old spool requests.
    Use
    As of Release 4.6C, the Job Definition transaction ( sm36 ) provides a list of important standard jobs, which you can schedule, monitor, and edit.
    Standard jobs are those background jobs that should be run regularly in a production SAP System. These jobs are usually jobs that clean up parts of the system, such as by deleting old spool requests.
    for more information you can go thru the following thread:
    http://help.sap.com/saphelp_nw70/helpdata/en/24/b884388b81ea55e10000009b38f842/frameset.htm
    About Events:
    Events have meaning only in the background processing system. You can use events only to start background jobs.
    Triggering an event notifies the background processing system that a named condition has been reached. The background processing system reacts by starting any jobs that were waiting for the event.
    Types of Events:
    There are two types of events:
    1.)System events are defined by SAP. These events are triggered automatically when such system changes as the activation of a new operation mode take place.
    2.)User events are events that you define yourself. You must trigger these events yourself from ABAP or from external programs. You could, for example, signal the arrival of external data to be read into the SAP system by using an external program to trigger a background processing event.The event scheduler processes an event if the event is defined in the system.
    For example, if a system (System 1) receives an event from another system (System 2), the event scheduler of System 1 processes the event only if it is defined in System 1. That event does not need to be defined in System 2 (the sending system).
    You define an event by assigning a name (EVENTID) to it. When defining an event, you do not define the event arguments.
    for more information you can go thru the following thread:
    http://help.sap.com/saphelp_nw04s/helpdata/en/fa/096e2a543b11d1898e0000e8322d00/frameset.htm
    When you schedule the process chain or infopackages the jobs associated with it run in the background mode. In case you want to create a job for a specific activity you can do so in SM36. You would be creating jobs that would get executed in any one of the options:
    1. Immediate
    2. Date & Time
    3. After event.
    4. After job.
    5. At Operation mode.
    In case you want to view the job logs go to sm37.
    Also Pls check DB02 for database performance and ST03 for workload .
    Analyse u will have an idea ,
    *pls assign points,if info is useful**
    Regards
    CSM reddy
    null

  • How to print Special Characters in Sap-Scripts

    How to print Special Characters in Sap-Scripts
    Thanks,
    Ravi

    Hi
    if u want print special characters we can use hot codes i.e '  '  (single inverted commas). in between these hot codes insert u r special characters.
    write    '    !@#$%^&*( )  '.
    for the above write statement output is
    output is   !@#$%^&*( )

  • How do you move pictures from one catalog to another?

    How do you move pictures from one catalog to another?  I have just got the program and have moved pictures into the default catalog. I have now created several new catalogs and want to move pics from the default into the new catalogs. I don't see this answer in the general help or my "dummies" book.

    pspack1 wrote:
    How do you move pictures from one catalog to another?  I have just got the program and have moved pictures into the default catalog. I have now created several new catalogs and want to move pics from the default into the new catalogs. I don't see this answer in the general help or my "dummies" book.
    It's not a good idea to create multiple catalogs. For one thing, this defeats the purpose of the Organizer as a way to search for and find your photos; the search can only operate within a single catalog. Also, there are no functions in PSE that work across multiple catalogs. And even though you can "manually" combine the catalogs if you so desire, you lose information such as collection/album membership, stacks, version sets, creations and a few other things.

  • How do I transfer my elements 8 catalog to a new computer?

    I am using Elements 8.  The program and catalog are located on the hard drive for my computer.  Photos are stored on an external hard drive.  I want to transfer my photoshop catalog to a new computer.  How do I do this?  I understand that I need to deactivate Elements 8 on the "old" computer before I load the program onto my new computer.  How do I make sure that the catalog is not lost and transfers to the new computer?  Thanks, DanOmaha

    Check out http://bit.ly/nTqkFc

  • How to identify missing records in a single-column table?

    How to identify missing records in a single-column table ?
    Column consists of numbers in a ordered manner but the some numbers are deleted from the table in random manner and need to identify those rows.

    Something like:
    WITH t AS (
               SELECT 1 ID FROM DUAL UNION ALL
               SELECT 2 ID FROM DUAL UNION ALL
               SELECT 3 ID FROM DUAL UNION ALL
               SELECT 5 ID FROM DUAL UNION ALL
               SELECT 8 ID FROM DUAL UNION ALL
               SELECT 10 ID FROM DUAL UNION ALL
               SELECT 11 ID FROM DUAL
    -- end of on-the-fly data sample
    SELECT  '[' || (id + 1) || ' - ' || (next_id - 1) || ']' gap
      FROM  (
             SELECT  id,
                     lead(id,1,id + 1) over(order by id) next_id
               FROM  t
      where id != next_id - 1
    GAP
    [4 - 4]
    [6 - 7]
    [9 - 9]
    SQL> SY.
    P.S. I assume sequence lower and upper limits are always present, otherwise query needs a little adjustment.

  • How to remove special characters in xml

    Dear friends,
    How to remove the special character  from the xml. I am placing the xml file and  fetching through file adapter.
    The problem is when there is any special character in xml. i am not able to pass to target system smoothly.
    Customer asking schedule the file adapter in order to do that the source xml should not have any special charatcters
    How to acheive this friends,
    Thanx in advance.
    Take care

    Hi Karthik,
    Go throgh the following links how to handle special character
    https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/9420 [original link is broken] [original link is broken] [original link is broken]
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/502991a2-45d9-2910-d99f-8aba5d79fb42
    Restricting special characters in XML within XI..
    Regards
    Goli Sridhar

  • How to write special characters in PDF using iText

    How to write special characters encoded with UTF-8 in PDF using iText.
    Regards,
    Pandharinath.

    I don't know what your problem is but that's almost certainly the wrong question to ask about it. Java (including iText) uses only Unicode characters. (You may consider some of them to be "special" if you like but Unicode doesn't.) And when it does that, they aren't encoded in UTF-8 or any other encoding.
    So can you describe your problem? That question doesn't make sense.

  • How to display special characters in Script...

    hi all,
    Can any one tell me how to display special characters in script...
    how to write in text element
    thanks in advance,
    prashant

    Hi Prashant ,
      What special characters would you like to include .
    There are a set of characters / icons /symbols that can be included in Script , for that open a window in edit mode and in the menu there will be an option called Insert  , here you can find a lot of characters/symbols that can be included .
    Regards,
    Arun

  • How to identify a type of consolidation in a system?

    Hi,
    I need to understand how to identify the type of consolidation we are doingion the system.
    Example like Step consolidation, Simultaneous consolidation or other method.
    This will be helpfull for me in doing my currest support issues.
    Thanks in advance,
    Richard..

    Not sure to understand your question.
    What is the precise context of your issue ? Is it a problem of SEM-BCS configuration or a general problem on how consolidation works ?

  • How to identify the user who created the variant

    Hi All,
    Can anyone tell me how to identify the user who created the variant ?

    Hi Dear,
    For the same go to SE11 and view the table "VARID". This table give the details of the program,user,variant etc.
    From this table u can know which user created the variant. Hope this solve your purpose.
    Regards

  • How to export special characters into an XML file?

    Dear experts,
    We read files from our customers and save data into our customized table without any character changed, including some address fields. In those address fields, some special characters (not in our code page) are also kept. When we want to write these address fields into an XML file or flat file, the special charcters become "##" or not readable, can anyone help us to solve this issue?
    Question1: How to write special code to an external file?
    Question2: how to use 'CALL TRANSFORMATION' from an internal table to an XML file?
    Your answer is highly appreciated!
    Joanne

    Hi Joanne.
    Please check the below link.
    CALL TRANSFORMATION
    Before that u have to create one transformation program in STRANS tcode for using it in call transformation statement.
    Hope it will be useful.
    Regards,
    Lakshman

  • How can identify the default currency for a customer?

    How can identify the default currency for a customer?
    I know that this is being determined when you create a sales order for a particular customer, for example, so I could break this process open and find out what it uses. But I thought it worth asking in this forum first.
    Blue

    Hi Gary,
    As per my understanding of your question I am replying , If you are looking some thing else then I request you to please elaborate your query.
    If you see the BP sales area data in transaction BP, In billing tab you maintain the currency for a customer which is default currency when you create a sales order.
    <b>Reward points if it helps!!</b>
    Best regards,
    Vikash

  • How to create and maintain a backup catalog, separate from default  location,  on and external HD

    How to create and maintain a backup catalog on a separate hd - separate from default location of the catalog?

    Simply copy the LR catalog backup file to another location. It’s quite small and only contains metadata e.g. your edit develop settings, keywords, captions, titles and camera exif data etc.
    The LR backup does not physically copy your image files. So make sure you have a separate system backup for your photo files and folders.

Maybe you are looking for

  • How can I set a version number for an AppleScript application?

    Subject kind of says it all... I've written a small application in AppleScript, which is used on several computers. I'd like the application to have a version number, just like normal applications have. How do I give it one? To be clear, what I mean

  • Can I use the OCR of the Officejet 6600 on pdf files without printing and scanning them?

    Product name: HP Officejet 6600 All in one Operating System: Windows 7 64-bit After scanning hundreds of pages to pdf format with the printer, I have realized that using the OCR scanning feature would have served my purposes better. (I don't have the

  • [SOLVED] Banshee does not play rtsp protocol

    rtsp streams (radio station) does not work in the last version of banshee (1.5.1-1). in fact it worked fine in previous version. After launching banshee in the terminal there appears: [miguel@miguel ~]$ banshee-1 [Info 21:14:42.263] Running Banshee 1

  • Helps Needed!!Database on Radio Buttons

    Hi i am currently working on a voting system whereby the data will be stored in ODBC..I am not able to use JRadioButton to store into the database access and I need helps fromwhoever can help mi..will appreciate greatly.thanks.. My codes are as follo

  • One Column missing during print functionality

    Hi All, Actuall i am using print Functionality in Apex the code is : <!-- <TD align=right><IMG height=3 alt="" src="#WORKSPACE_IMAGES#spacer.gif" width=1 border=0><BR><IMG height=15 alt="Print this" src="#WORKSPACE_IMAGES#drucken.gif" onClick="window