Cannot drop login from SQL 2012

I am trying to drop a login with no mapped dbs, no owned schemas, no rights, no endpoints, nothing what-so-ever and I have been at this for 4 hours.  This is the error, is there any global way to determine what in the world SQL 2012 sees this login
as owning?????
Msg 15141, Level 16, State 1, Line 1
The server principal owns one or more server role(s) and cannot be dropped.

****************To check User Own Schema
select * from sys.schemas where principal_id = user_id('user_name')
select * from sys.database_principals where owning_principal_id in (
select principal_id from sys.database_principals where name='DomainName\UserName')
ALTER AUTHORIZATION ON SCHEMA::SchemaName TO dbo
*************** To Transfer any object owned by user/principal
SELECT 'ALTER SCHEMA [dbo] TRANSFER [' + SCHEMA_NAME([schema_id]) + '].[' + [name] + '];'
FROM sys.objects
WHERE [schema_id] IN (SELECT [schema_id] FROM sys.schemas WHERE principal_id = USER_ID('DomainName\UserName'))
************** To Check Role Owner
select dp2.name as role, dp1.name as owner
from sys.database_principals as dp1 inner join sys.database_principals as dp2
on dp1.principal_id = dp2.owning_principal_id
where dp1.name = 'Username'
************** To Change Role Owner
ALTER AUTHORIZATION ON ROLE::[RoleName] TO [dbo];

Similar Messages

  • Cannot drop column from table owned by SYS

    Hello everybody,
    How can I drop a column of table which is owned by sys? thanks!
    Result as follows:
    SQL> ALTER TABLE HELLO_TB DROP COLUMN NUM;
    ALTER TABLE HELLO_TB DROP COLUMN NUM
    ERROR at line 1:
    ORA-12988: cannot drop column from table owned by SYS
    newbie v

    You can not 'change' the ownership.
    You can, however, 'move' or 'clone' most objects by exporting and importing. As follows:
    I create a table under SYS (shudder).
    I then export it
    - using userid SYS in this case,
    - under normal circumstances I'd either use a DBA account or the owner's userid
    - since I want a table, I use the TABLES option - a list is comma separated and in quotes
    I then import it using a 'userid' switch - fromuser & touser options
    - in this case from SYS to HR
    Finally, I verify it was transported.
    Actual console session in Linux follows:
    pop2@fuzzy:~> sqlplus / as sysdba
    SQL*Plus: Release 10.2.0.1.0 - Production on Fri Mar 10 19:58:01 2006
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    SQL> create table test1 ( x1 number );
    Table created.
    SQL> insert into test1 values (2);
    1 row created.
    SQL> select * from test1;
            X1
             2
    SQL> Disconnected from Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    pop2@fuzzy:~> exp file=exp.dmp tables='TEST1'
    Export: Release 10.2.0.1.0 - Production on Fri Mar 10 20:00:07 2006
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Username: sys/????? as sysdba
    Connected to: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    Export done in AL32UTF8 character set and AL16UTF16 NCHAR character set
    About to export specified tables via Conventional Path ...
    . . exporting table                          TEST1          1 rows exported
    Export terminated successfully without warnings.
    pop2@fuzzy:~> imp file=exp.dmp fromuser=sys touser=hr
    Import: Release 10.2.0.1.0 - Production on Fri Mar 10 20:00:44 2006
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Username: sys/????? as sysdba
    Connected to: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    Export file created by EXPORT:V10.02.01 via conventional path
    import done in AL32UTF8 character set and AL16UTF16 NCHAR character set
    . importing SYS's objects into HR
    . . importing table                        "TEST1"          1 rows imported
    Import terminated successfully without warnings.
    pop2@fuzzy:~> sqlplus hr/hr
    SQL*Plus: Release 10.2.0.1.0 - Production on Fri Mar 10 20:00:57 2006
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    SQL> select * from test1;
            X1
             2
    SQL>The export/import pair are incredibly powerful - and few people understand them well. If you are interested in digging into their capability, check out their chapters in the Utilities manual (under the Books tab) at http://www.oracle.com/pls/db102/portal.portal_db?selected=1

  • Fetching from SQL 2012

    Hi folks,
    We are using  Oracle application 12.1.1 , Database version 10.2.0.4 on Solaris 10 plaform, and we have Micorsoft SQl server 2012 Database on windows
    2008 server  service pack 2.
    i have created the same tables which i need  to fetching data from SQL server database to EBS application i mean oracle Database
    So my question is here how can i fetch the data from  Oracle application  and load into Oracle Database from SQL 2012.
    can one suggest me or give any link which tell about details steps.
    thanks & Regards.

    Hi,
       There are 2 different ways you could do this.
    1. You could use an Oracle Gateway product - either Database Gateway for SQL*Server (Dg4MSQL) or Database Gateway for ODBC (Dg4ODBC) - and use SQL to select from the SQL*Server tables and put into Oracle tables.
    If you have access to My Oracle Support then the following note has links to further details -
    Master Note for Oracle Gateway Products (Doc ID 1083703.1)
    or this link if you do not -
    Oracle Database Gateways
    2. Oracle GoldenGate
    This can automatically replicate data from SQL*Server to Oracle or vice versa if necessary.
    See here for further details -
    Oracle GoldenGate
    Regards,
    Mike

  • Add login to sql 2012 server for a virtual account from another sql 2012 server

    I have two sql 2012 servers. 
    Server A has sql server agent running virtual account: NT Service\SQLSERVERAGENT
    Server B has some databases.
    Server A is running a scheduled SSIS package that needs access to Server B's databases via Windows Auth
    Thus I want to grant access by creating a login on Server B to the virtual account on server A: NT Service\SQLSERVERAGENT
    Q1 - Is this possible?
    Thanks beforehand.
    Paulino

    Raul,
    As a matter of a test and not with the actual intention to use it this way, I did try to add a login using the DOMAIN\MACHINE_NAME$
    concept but it did not work anyway. I will not find it.
    So I will use one of the approaches recommended by Mr. Gallardy
    Thanks!
    Paulino

  • 32-bit iFilter with Reader 11.0.10 cannot be found by SQL 2012 Fulltext Indexing on Windows 7 32 bit. How can I fix this?

    I have verified that a record shows up in the fulltext system components (EXEC sys.sp_help_fulltext_system_components 'filter').
    componenttype    componentname    clsid    fullpath    version    manufacturer
    filter    .pdf    E8978DA6-047F-4E3D-9C78-CDBE46041603    C:\Program Files\Adobe\Reader 11.0\Reader\AcroRdIF.dll    11.0.0.379    Adobe Systems, Inc.
    I have also added Reader's installation folder to my system PATH variable, and ran these 3 things:
    EXEC sp_fulltext_service 'update_languages';
    EXEC sp_fulltext_service 'load_os_resources', 1;
    EXEC sp_fulltext_service 'restart_all_fdhosts';
    and then dropped and re-created my fulltext index.  For each row in the table, I receive a message like this:
    Warning: No appropriate filter was found during full-text index population for table or indexed view '[DocumentIndexing].[dbo].[Document]' (table or indexed view ID '277576027', database ID '8'), full-text key value '17'. Some columns of the row were not indexed.
    In the Registry, under HKEY_CLASSES_ROOT / .pdf / PersistentHandler is the value {F6594A6D-D57F-4EFD-B2C3-DCD9779E382E}.
    I have tried several times to install/fix my PDF installation, restart SQL Server, Reboot my laptop, etc.  All to no avail.
    I saw the article on the 64-bit filter and was able to successfully do that on another workstation (Windows 8.1 64-bit SQL 2012).  However, I really need this working on my laptop.
    Do you have a solution or workaround or some recommendations for me to move forward with this?
    Thanks,
    Dave

    I found the solution.  Here it is:
    Take backup of below registry key.
    HKLM\SOFTWARE\Microsoft\Cryptography\MachineGuid This key should ideally have the GUID of the machine without curly braces, so {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} becomes xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
    Then delete the braces.
    Try to reboot and start the SQL service . If service don’t start then Uninstall and reinstall SQL.
    The MachineGuid had curly braces so I removed them and rebooted my laptop.  Now both instances of SQL Server start.  It is the last post of this thread:
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/56f14665-3f00-41ff-b002-bb5e86b3f219/sql-server-not-starting-fallback-certificate-initialization-failed?forum=sqlsecurity
    He states that he got it from Microsoft but did not give the url.
    Thanks for all your help.
    Fred Schmid

  • Secure login to sql 2012 database for webusers

    We build up a new website in .net mvc 4.0 on a w2012 server with MSSQL 2012 database.
    We use windows autentification and normal anonymous access through NT AUTHORITY\IUSR who is also a login in the database.
    But we make extra login possibility for users who are registered and they can insert and modify data in some tables in the database. And I'am afraid of giving NT AUTHORITY\IUSR insert and update for some column in tables.
    I think of set up a new login for the database. Run a new connection string on login and set up special permission for that extra user on the database, set up a new role and let the new user become member, but also let the user become a member of the ordinary
    user(roles) in the database.
    Have anyone any idea what is the best practice here and the most secure way to do it? 
    Any links for other resources about this topic?
    Or perhaps my fear for using NT AUTHORITY\IUSR is groundless
    And perhaps someone has links to resources for using SQL server as a backendserver for websites. 
    Knut from Norway!

    I don't know much about web servers, which may explain your alternatives entirely.
    But, if you use the same connection string for reads that you do for updates, then you must control all permission for writes in the web app. And you must be sure that you only use parameterised SQL or stored procedures, so that there is no risk for SQL
    injection.
    If you give special logins for the users with read access, they would need their own accounts in SQL Server. If this is an intranet site, the web server may be able to impersonate these users and then connect to SQL Server. If that does not work out, you
    would have to create SQL logins for these.
    Obviously, this requires more administration, but it is also more secure, because you are adding a line of defence. Even if your application is free from SQL injection vulnerabilities today, some new badly educated kid on the block could open a hole two
    years later.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Silent install parameters for Mgmt Studio (from SQL 2012 SP1 Express)

    Hi All,
    I'm looking to incorporate the installation of SQL Management studio ONLY from the SQL 2012 Sp1 Express bundle, into System Centre Configuration Manager. I need the silent installation options to install all features for it.
    File used - SQLManagementStudio_x64_ENU.exe
    From URL - http://www.microsoft.com/en-ca/download/details.aspx?id=35579
    I'm looking for something like this:
    "SQLManagementStudio_x64_ENU.exe /ACTION=INSTALL /QUIET /IAcceptSQLServerLicenseTerms="True"
    /FEATURES= etc.....
    Can anyone point me in the right direction? I just want to run the command and have it install SQL 2012
    Management Studio (this one is the full version) without having to run through the whole setup.exe process and it's silent installation..
    Thanks in advance

    Hello,
    First you need to extract the content of the .EXE file to a local folder, as shown below:
    SQLManagementStudio_x64_ENU.exe /x
    Then you can try to run the following command:
    "c:\folder_containing_installation_files\setup.exe" /ACTION=INSTALL /QUIET /FEATURES=SSMS /HIDECONSOLE
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • Need to recover dropped indexes from SQL Server 2008 R2

    Hi All,
    we are reestablishing the transaction replication all non-clustered indexes dropped due to this activity now we are suffering from performance issue is there any way ,we can recover all the dropped indexes.
    Regards,
    Pawan Singh
    Thanks

    Hi Pawan,
    I had blogged about this in the past
    http://sqllearnings.com/2012/04/04/subscription-re-initialization-and-non-clustered-indexes/
    When you re-initialize there is an option which you need to set to true for the non-clustered indexes to be applied in the subscriber end.
    If your replication re-initialization is pretty fast then you can set the option to true and then re-apply the snapshot..
    Else easiest option is to script the indexes from publisher and create them in the subscriber.
    HTH
    Regards, Ashwin Menon My Blog - http:\\sqllearnings.com

  • Key is not visible in SQL 2012 R2 when query is read from SAP BI

    Hi All,
    I have a query in sap bi which has variables where key and text is displayed as per screen shot 1. How ever the same query is triggered from SQL 2012 r2 the key is not visible but text is visible as per screenshot 2  . Could any one suggest how the key will be displayed by there end(SQL).
    Thanks,
    Payani

    I think you're in the wrong space as yor screenshots are not from any Business Objects or SAP BI 4.x products I know.
    What exact product are you using ?
    this space is for SAP Business Objects products family.

  • SQL 2000 LINKED SERVER ERROR 7303 WITH SQL 2012 ON WINDOWS SERVER 2012 R2

    Hi all,
    I have a problem with SQL Server 2012 and a linked server for SQL 2000 database.
    System specification:
    Windows server 2012 64 bit
    SQL SERVER 2012 64 bit
    REMOTE SERVER SQL 2000 32 bit
    I've installed sql native client 32bit,create a SYSTEM DSN odbc connection with "SQL Server" driver named "MYSERVER".
    Create a linked server with the query below in SQL 2012:
    EXEC master.dbo.sp_addlinkedserver @server =N'MYSERVER', @srvproduct=N'MYSERVER', @provider=N'MSDASQL', @datasrc =N'MYSERVER', @location=N'System';
    EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname=N'MySERVER',@useself=N'True',@locallogin=NULL,@rmtuser=NULL,@rmtpassword=NULL
    GO
    but when i browse the linked server i receved error 7303.

    You need 64-bit MSDASQL. It is the bitness of the server you are connecting from that matters. 64-bit executables cannot hook into 32-bit DLL.
    However, I suspect that you will not get things to work anyway. At least I have not seen anyone this far who has been able to set up a linked server from SQL 2012 to SQL 2000. I know that when I tried this, the following providers had this result:
    SQLNCLI11 - does not support connections to SQL 2000.
    SQLNCLI10 - failed with some obscure message that I don't recall.
    SQLNCLI - Don't recall that the problem was here.
    SQLOLEDB - SQLOLEDB is always replaced with the most recent version of SQLNCLI, so this fails because of lack of support.
    I don't think I got through all version of the ODBC drivers, though.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Error 997. Overlapped I/O operation is in progress. When applying SQL 2012 SP2 to a FCI passive Node

    Hello
    I am upgrading my 2 node FCI cluster from SQL 2012 SP1 to SP2. I was able to update one node, then I did failover to the upgraded node but now I cannot update the other node (passive)
    I am getting "Error 997. Overlapped I/O operation is in progress"
    Any ideas ?
    Here is a piece of the log file
    MSI (s) (64:AC) [16:26:02:861]: SECREPAIR: A general error running CryptAcquireContext
    MSI (s) (64:AC) [16:26:02:861]: SECREPAIR: Crypt Provider not initialized. Error:0
    MSI (s) (64:AC) [16:26:02:861]: SECREPAIR: A general error running CryptAcquireContext
    MSI (s) (64:AC) [16:26:02:861]: SECREPAIR: Crypt Provider not initialized. Error:997
    MSI (s) (64:AC) [16:26:02:861]: SECUREREPAIR: Failed to CreateContentHash of the file: Program Files\Microsoft SQL Server\110\Setup Bootstrap\SQLServer2012\1033_ENU_LP\x64\1033\license_SQLBI_OEM.rtf: for computing its hash. Error: 997
    MSI (s) (64:AC) [16:26:02:861]: SECREPAIR: Failed to create hash for the install source files
    MSI (s) (64:AC) [16:26:02:861]: SECUREREPAIR: SecureRepair Failed. Error code: 3e5E78034B8
    Action start 16:26:02: ProcessComponents.
    MSI (s) (64:AC) [16:26:02:876]: 
    Error 997. Overlapped I/O operation is in progress.
    MSI (s) (64:AC) [16:26:02:923]: Machine policy value 'DisableRollback' is 0
    MSI (s) (64:AC) [16:26:02:923]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\Rollback\Scripts 3: 2 
    Action ended 16:26:02: ProcessComponents. Return value 3.
    MSI (s) (64:AC) [16:26:02:923]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\Rollback\Scripts 3: 2 
    MSI (s) (64:AC) [16:26:02:923]: No System Restore sequence number for this installation.
    MSI (s) (64:AC) [16:26:02:923]: Unlocking Server
    Action ended 16:26:02: INSTALL. Return value 3.
    Property(S): DiskPrompt = [1]
    Property(S): InstallMode = Typical
    Property(S): UpgradeCode = {6B5C1D2B-86A6-4714-9BC6-5E32D608E551}
    Property(S): WelcomeBmp = WelcomeBmp
    Property(S): OPENREADME = 1
    Property(S): CurrentSetupBootstrap_64 = c:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\SQLServer2012\x64\
    Property(S): GAC_64 = c:\Windows\Gac\
    Property(S): GAC_32 = c:\Windows\Gac_32\
    Property(S): Ver_64 = c:\Program Files\Microsoft SQL Server\110\
    Property(S): SetupBootstrap_64 = c:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\
    Property(S): CurrentSetupHelpNative_64_1033 = c:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\SQLServer2012\1033_ENU_LP\x64\1033\help\
    Property(S): CurrentSetupBootstrapNative_64_1033 = c:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\SQLServer2012\1033_ENU_LP\x64\1033\
    Property(S): CurrentSetupBootstrapRes_64_1033 = c:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\SQLServer2012\Resources\1033\
    Property(S): Shared_64 = c:\Program Files\Microsoft SQL Server\110\Shared\
    Javier Villegas |
    @javier_vill | http://sql-javier-villegas.blogspot.com/
    Please click "Propose As Answer" if a post solves your problem or "Vote As Helpful" if a post has been useful to you

    Judging by the error message I would say the setup is trying to access a network share that is no longer available to the node due to the failover. How many instances are installed in each node?
    Open resource monitor and, in the disk section, check which files are being accessed by I/O threads. See if there are any files in use that the SP2 installer would supposedly try to access.
    If possible, save the resource monitor results, failback the instance, and check disk usage in the other node to try to detect any abnormal disk access.

  • How to upgrade SQL 2012 Clustering Enterprise Evaluation to SQL 2012 Clustering Standard Editon

    Dear All,
        My environment configured 2 Servers for SQL 2012 Clustering Enterprise Evaluation with Active/Passive. Then I Would like to upgrade from SQL 2012 Clustering Enterprise Evaluation to SQL 2012 Clustering Standard Edition with Active/Passive
    on same 2 Servers.
        I would like you help to share me the step how to upgrade from SQL 2012 Clustering Enterprise Evaluation to SQL 2012 Clustering Standard Edition.
        I should upgrade on both Servers or just upgrade only one of them?
        I should upgrade on Active node first or passive node first?
        During upgrade, I should bring offline resource before upgrade?
    I saw only step upgrade evaluation edition on standalone Server but can't find information for upgrade on Cluster environment.
    Could you please help provide me the step for do this. 

    Hello,
    As per this MS article
    http://technet.microsoft.com/en-us/library/ms143393.aspx
    Upgrading from Evaluation Enterprise (a free edition) to any of the paid editions is supported for stand-alone installations, but is not supported for clustered installations.
    Changing the edition of a SQL Server 2012 failover cluster is limited. The following scenarios are not supported for SQL Server 2012 failover clusters:
    SQL Server 2012 Enterprise to SQL Server 2012 Developer, Standard, or Enterprise Evaluation.
    SQL Server 2012 Developer to SQL Server 2012 Standard or Enterprise Evaluation.
    SQL Server 2012 Standard to SQL Server 2012 Enterprise Evaluation.
    SQL Server 2012 Enterprise Evaluation to SQL Server 2012 Standard.
    So i think upgrade to Standard edition is not possible on cluster.
    What you can do is take full and transaction log backup of All databases.Backup your users and logins and jobs by script method.
    Now destroy SQL server 2012 evaluation cluster and create new SQL server standard cluster.
    Just FYI( not related to this): You just need to run edition upgrade on a single node, you can choose to run from either an active or passive node. After running, you need to cause a failover to happen. Once the failover happens, all of the nodes along with
    the database engine will be updated.
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • SQL 2012 AlwaysOn upgrade to SQL 2014

    Anyone have some info regarding inplace upgrade from SQL 2012 AlwaysOn to SQL 2014 ?
    -Arnstein

    Hi,
    Please check the following articles:
    Upgrade and Update of Availability Group Servers with Minimal Downtime and Data Loss
    https://msdn.microsoft.com/en-us/library/dn178483.aspx
    Thanks.

  • Linked Server : SQL 2012 to 2000 error - Microsoft Distributed Transaction Coordinator (MS DTC) has stopped this transaction.

    Hi all,
      If any one has worked around this error and can help ?
    Msg 8522, Level 16, State 3, Line 1
    Microsoft Distributed Transaction Coordinator (MS DTC) has stopped this transaction.
      I am trying to connect from sql 2012 to 2000 server. Established linked server using native client 10. I am able to see catalogs and database and table. Just when I am trying to query i am getting above error. 
    any help is really appreciated. 
    Thanks
    Please Mark As Answer if it is helpful. \\Aim To Inspire Rather to Teach

    Hi Logicinisde,
    What the new error message do you get after using the workarounds in this
    blog? Please post it for analysis.
    Besides, as SQL Server 2012 has stopped connecting to SQL Server 2000 via linked servers, personally I recommend you upgrade SQL Server 2000 to a higher version to make your queries or ETLs efficient.
    Thanks,
    Lydia Zhang
    Lydia Zhang
    TechNet Community Support

  • Failed to create LOGIN from a domain account on SQL Server 2012

    Hello,
    My environment is like,
    A Domian Controller (with the domain name: CONTOSO) hosted by a Windows Server 2008 R2.   --- Server 1
    A SQL Server 2012 x64 runs on another Windows Server 2008 R2 (this Server has been added into the CONTOSO domain).  --- Server 2
    I am trying to create a SQL login on Server 2 with the statement shown below:
    CREATE LOGIN "CONTOSO\domain_group_b" FROM WINDOWS;
    while, an error occurred,
    Msg 15401, Level 16, State 1, Line 1
    Windows NT user or group 'CONTOSO\domain_group_b' not found. Check the name again.
    I've made sure that the domain group account "domain_group_b" has been created on Server 1.
    Is anything else needed to be done?

    Pretty pretty sorry for my bad explanation in English.
    Yes, the Server 2 (the actual name of this server is "SQL-A", the Server 1's name is "DC") has been a member of CONTOSO. 
    I typo the domain name CONTOSO as CONTSO, but I keep using CONTSO everywhere.
    These two servers are hosted by Hyper-V.
    I could login on server2 by the domain user "domain_user_b".
    It seems that neither the domain group, "domain_group_b" nor the domain user, "domain_user_b" cannot be associated when creating a SQL login.
    SQL-A captures:

Maybe you are looking for