CLR fce in MS SQL 2012 DirectoryServicesPermission failed

Hello,
I did this all and result isnt good :-)
When I try to call the function dbo.fn_jk_ver_email(@param) the error occurs:
// SQL settings
USE master
GO
CREATE ASYMMETRIC KEY DirectoryServices_Key
FROM EXECUTABLE FILE = 'C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.DirectoryServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.DirectoryServices.dll';
CREATE LOGIN DirectoryServices_Login
FROM ASYMMETRIC KEY DirectoryServices_Key;
GRANT EXTERNAL ACCESS ASSEMBLY TO DirectoryServices_Login;
GRANT UNSAFE ASSEMBLY TO DirectoryServices_Login;
GO
USE CRMMAFRA_TEST_23032014
GO
CREATE ASSEMBLY DirectoryServices FROM 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.DirectoryServices.dll' --na serveru
WITH PERMISSION_SET = UNSAFE;
GO
-- Create My_CLR_function in SQL
USE CRMMAFRA_TEST_23032014
GO
CREATE FUNCTION [dbo].[fn_jk_ver_email]( @adresa nvarchar(100))
RETURNS int
WITH EXECUTE AS CALLER
AS
EXTERNAL NAME LDAP_CLR.UserDefinedFunctions.jk_ver_email;
GO
//CLR fce deployed into SQL
using System;
using System.Data;
using System.DirectoryServices.AccountManagement;
using System.DirectoryServices;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using Microsoft.SqlServer.Server;
public partial class UserDefinedFunctions
[Microsoft.SqlServer.Server.SqlFunction]
public static SqlInt32 jk_ver_email(string emailadresamoje)
int vysledek = 0;
int firstCharacter = emailadresamoje.IndexOf("@") + 1;
string domena = emailadresamoje.Substring(firstCharacter);
string ldapstr = "LDAP://" + domena;
emailadresamoje = emailadresamoje.ToLower();
using (DirectoryEntry entry = new DirectoryEntry(ldapstr))
DirectorySearcher dSearch = new DirectorySearcher(entry);
dSearch.Filter = "(objectClass=user)";
foreach (SearchResult sResultSet in dSearch.FindAll())
if (sResultSet.Properties["mail"].Count > 0)
//if (String.ReferenceEquals(sResultSet.Properties["mail"][0].ToString(), emailadresamoje))
bool result = Equals(sResultSet.Properties["mail"][0].ToString().ToLower(), emailadresamoje);
if (result)
vysledek = 1;
return new SqlInt32(vysledek);
Msg 6522, Level 16, State 2, Line 1
A .NET Framework error occurred during execution of user-defined routine or aggregate "fn_jk_ver_email":
System.Security.SecurityException: Request for the permission of type 'System.DirectoryServices.DirectoryServicesPermission, System.DirectoryServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed.
System.Security.SecurityException:
   at UserDefinedFunctions.jk_ver_email(String emailadresamoje)

Hi
I've fixed this finally - at least for me!
It appears that if your assembly is using an assembly that has been marked as 'unsafe' - such as the DirectoryServices one - then your own assembly must be set to 'unsafe' as well. I changed a number of things in Visual Studio to this affect and then re-published
and the error went away and it all works fine now, AD from SQL server! However, I didn't use any of the manual scripted key generation code though that you used. The only T-SQL I used in this whole project was this...
ALTER DATABASE MyDatabase SET TRUSTWORTHY ON
GO
IF NOT EXISTS (SELECT * FROM sys.assemblies WHERE [name] = 'System.DirectoryServices.AccountManagement')
BEGIN
CREATE ASSEMBLY [System.DirectoryServices.AccountManagement]
FROM 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.DirectoryServices.AccountManagement.dll'
WITH PERMISSION_SET = UNSAFE
END
And these are the steps to what I changed in Visual Studio...
1) First right click on the project in the solution explorer to get the project settings tabs up...
2) Under the 'Project Settings' tab click on the 'Database Settings' button, when the dialog comes up goto the 'Miscellaneous' tab and tick the 'Trustworthy' option (even if you've set the database as trustworthy in SQL server using T-SQL still do this,
wouldn't work for me until I did this as well)
3) Next under the 'SQLCLR' tab set the assembly permission level to 'UNSAFE'
4) Lastly (not sure if this is required) still under the 'SQLCLR' tab click on the 'Signing' button and create a new strong name key file, call it anything and click ok and make sure that it's now showing as the selected strong name key file. Probably a
security risk but hey. Then don't forget to click ok!
5) Save everything and rebuild, then publish to your database and test again - hopefully it works!
Good luck
Padigan

Similar Messages

  • SQL 2012 SP1 fails to complete, Repair Install fails

    Somewhere, SQL 2012 stopped running.  This is developer copy.  I believe also that SP1 was trying to install and found that SQL Engine was not running.  In attempts to repair, I use the DVD and the repair process.   But that stalls/dies
    because SP1 is still not completed in install.  Deadlock.  I was attempting to repair, restore Master but cannt get pass the SP install hang.  Any thoughts on how to stop SP1 install, avoid hang and use DVD repair install?

    Overall summary:
      Final result:                  Failed: see details below
      Exit code (Decimal):           -2068578303
      Exit facility code:            1204
      Exit error code:               1
      Exit message:                  The specified value for setting 'MEDIALAYOUT' is invalid. The expected values are:     None  Core  Advanced 
    Full
      Start time:                    2013-12-19 10:28:33
      End time:                      2013-12-19 10:28:57
      Requested action:              None
    Machine Properties:
      Machine name:                  S129
      Machine processor count:       2
      OS version:                    Windows 7
      OS service pack:               Service Pack 1
      OS region:                     United States
      OS language:                   English (United States)
      OS architecture:               x64
      Process architecture:          64 Bit
      OS clustered:                  No
    Package properties:
      Description:                   Microsoft SQL Server 2012 Service Pack 1
      ProductName:                   SQL Server 2012
      Type:                          RTM
      Version:                       11
      SPLevel:                       0
      Installation location:         F:\x64\setup\
      Installation edition:         
    User Input Settings:
      ACTION:                        None
      CONFIGURATIONFILE:            
      ENU:                           true
      HELP:                          false
      IACCEPTSQLSERVERLICENSETERMS:  false
      INDICATEPROGRESS:              false
      QUIET:                         false
      QUIETSIMPLE:                   false
      UIMODE:                        Normal
      X86:                           false
      Configuration file:            C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20131219_102831\ConfigurationFile.ini
    Rules with failures:
    Global rules:
    There are no scenario-specific rules.
    Rules report file:               The rule result report file is not available.
    Exception summary:
    The following is an exception stack listing the exceptions in outermost to innermost order
    Inner exceptions are being indented
    Exception type: Microsoft.SqlServer.Chainer.Infrastructure.InputSettingValidationException
        Message:
            The specified value for setting 'MEDIALAYOUT' is invalid. The expected values are:
            None
            Core
            Advanced
            Full
        HResult : 0x84b40001
            FacilityCode : 1204 (4b4)
            ErrorCode : 1 (0001)
        Data:
          SQL.Setup.FailureCategory = InputSettingValidationFailure
          DisableWatson = true
          HelpLink.EvtType =
    0x28498E8E@0x2841E06E@1204@1
        Stack:
            at Microsoft.SqlServer.Chainer.Infrastructure.InputSettingService.SaveInputSettingValueToObjectEnum(Setting setting, InputSettingSource source, String[] stringValues)
            at Microsoft.SqlServer.Chainer.Infrastructure.InputSettingService.SaveParsedArgumentsIntoSettings(InputSettingSource source, Dictionary`2 parsedArguments, Boolean chainerSetting, Boolean ignoreSettingsForNotAllowedScnearios)
            at Microsoft.SqlServer.Chainer.Infrastructure.InputSettingService.ProcessCommandLineArguments(String[] commandLineArguments, Boolean chainerSetting)
            at Microsoft.SqlServer.Configuration.BootstrapExtension.ProcessChainerCommandLineArgumentsAction.ExecuteAction(String actionId)
            at Microsoft.SqlServer.Chainer.Infrastructure.Action.Execute(String actionId, TextWriter errorStream)
            at Microsoft.SqlServer.Setup.Chainer.Workflow.ActionInvocation.ExecuteActionHelper(TextWriter statusStream, ISequencedAction actionToRun, ServiceContainer context)

  • SQL 2012 install fails with 'Object reference not set to an instance of an object.'

    Hi, I'm trying to install SQL 2012 RTM Enterprise on a Windows 2008 R2 single node cluster.
    The installer starts goes through some checks and then fails with the message 'Object reference not set to an instance of an object.' It happens while the small 'wait while...' dialog box is
    showing, another window pops up briefly (I think the feature selection window - can't really tell as it doesn't draw before disappearing). Then the ‘Object reference not set’ message comes up.
    From the summary log file..
    Overall summary:
    Final result:                 
    Failed: see details below
    Exit code (Decimal):          
    -2147467261
    Exit facility code:           
    0
    Exit error code:              
    16387
    Exit message:                 
    Object reference not set to an instance of an object.
    Start time:                   
    2012-09-26 08:52:53
    End time:                     
    2012-09-26 08:54:08
    Requested action:             
    InstallFailoverCluster
    Exception help link:          
    http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.2100.60&EvtType=0x9AF1AE5E%400x44A889F9&EvtType=0x9AF1AE5E%400x44A889F9
    Exception summary:
    The following is an exception stack listing the exceptions in outermost to innermost order
    Inner exceptions are being indented
    Exception type: System.NullReferenceException
    Message:
    Object reference not set to an instance of an object.
    Data:
    HelpLink.EvtType = 0x9AF1AE5E@0x44A889F9
    DisableWatson = true
    Stack:
    at Microsoft.SqlServer.Configuration.RulesEngineExtension.RulesEngine.ShouldRuleRun(Rule rule)
    at Microsoft.SqlServer.Configuration.RulesEngineExtension.RulesEngine.IsRuleSkipped(Rule rule)
    at Microsoft.SqlServer.Configuration.RulesEngineExtension.RulesEngine.LoadRule(String ruleId, List`1 ruleProperties, XmlSchema ruleSchema, XmlElementParserFactory elementParser)
    at Microsoft.SqlServer.Configuration.RulesEngineExtension.RulesEngine.LoadRules(IEnumerable`1 ruleIds)
    at Microsoft.SqlServer.Configuration.InstallWizard.RunRuleProgressController.Initialize()
    I have rebooted, tried different media, tried uninstalling the setup files and rerunning but always get the same result.
    Any help would be gratefully accepted.
    Thanks,
    Bruce.

    Hi Alberto,
    Whenever I am trying to install SQL 2012 with SP1 clustering, I am getting below error. Can you please advise on this. 
    Additional information are
    Windows Servers Version and Edition - Windows 2012 Strandedition
    SQL Server Version and Edition - SQL 2012 with SP1
    All the machines are running on Hyper-V and Passed the cluster validation test successfully. there is no issue. The servers' (Nodes) names are;
    DomainServerName - ACONDomainGroup (1gb ram allocated)
    Node1 - AconNODE1W2K12STD (2.5gb ram allocated )
    Node2 - AconNODE2W2K12STD (1.5 ram allocated allocated)
    WindowsClusterName - AconWinCLTR
    Below is  Summary.txt Error
      Update Source:                 MU
    User Input Settings:
      ACTION:                        InstallFailoverCluster
      AGTDOMAINGROUP:                <empty>
      AGTSVCACCOUNT:                 <empty>
      AGTSVCPASSWORD:                <empty>
      ASBACKUPDIR:                   Backup
      ASCOLLATION:                   Latin1_General_CI_AS
      ASCONFIGDIR:                   Config
      ASDATADIR:                     Data
      ASLOGDIR:                      Log
      ASPROVIDERMSOLAP:              1
      ASSERVERMODE:                  MULTIDIMENSIONAL
      ASSVCACCOUNT:                  <empty>
      ASSVCPASSWORD:                 <empty>
      ASSVCSTARTUPTYPE:              Automatic
      ASSYSADMINACCOUNTS:            <empty>
      ASTEMPDIR:                     Temp
      COMMFABRICENCRYPTION:          0
      COMMFABRICNETWORKLEVEL:        0
      COMMFABRICPORT:                0
      CONFIGURATIONFILE:             
      ENU:                           true
      ERRORREPORTING:                false
      FAILOVERCLUSTERDISKS:          <empty>
      FAILOVERCLUSTERGROUP:          
      FAILOVERCLUSTERIPADDRESSES:    <empty>
      FAILOVERCLUSTERNETWORKNAME:    <empty>
      FEATURES:                      
      FILESTREAMLEVEL:               0
      FILESTREAMSHARENAME:           <empty>
      FTSVCACCOUNT:                  <empty>
      FTSVCPASSWORD:                 <empty>
      HELP:                          false
      IACCEPTSQLSERVERLICENSETERMS:  false
      INDICATEPROGRESS:              false
      INSTALLSHAREDDIR:              C:\Program Files\Microsoft SQL Server\
      INSTALLSHAREDWOWDIR:           C:\Program Files (x86)\Microsoft SQL Server\
      INSTALLSQLDATADIR:             <empty>
      INSTANCEDIR:                   C:\Program Files\Microsoft SQL Server\
      INSTANCEID:                    <empty>
      INSTANCENAME:                  <empty>
      ISSVCACCOUNT:                  NT AUTHORITY\Network Service
      ISSVCPASSWORD:                 <empty>
      ISSVCSTARTUPTYPE:              Automatic
      MATRIXCMBRICKCOMMPORT:         0
      MATRIXCMSERVERNAME:            <empty>
      MATRIXNAME:                    <empty>
      PID:                           *****
      QUIET:                         false
      QUIETSIMPLE:                   false
      RSINSTALLMODE:                 DefaultNativeMode
      RSSHPINSTALLMODE:              DefaultSharePointMode
      RSSVCACCOUNT:                  <empty>
      RSSVCPASSWORD:                 <empty>
      RSSVCSTARTUPTYPE:              Automatic
      SAPWD:                         <empty>
      SECURITYMODE:                  <empty>
      SQLBACKUPDIR:                  <empty>
      SQLCOLLATION:                  SQL_Latin1_General_CP1_CI_AS
      SQLSVCACCOUNT:                 <empty>
      SQLSVCPASSWORD:                <empty>
      SQLSYSADMINACCOUNTS:           <empty>
      SQLTEMPDBDIR:                  <empty>
      SQLTEMPDBLOGDIR:               <empty>
      SQLUSERDBDIR:                  <empty>
      SQLUSERDBLOGDIR:               <empty>
      SQMREPORTING:                  false
      UIMODE:                        Normal
      UpdateEnabled:                 true
      UpdateSource:                  MU
      X86:                           false
      Configuration file:            C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20140420_052344\ConfigurationFile.ini
    Rules with failures:
    Global rules:
    There are no scenario-specific rules.
    Rules report file:               C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20140420_052344\SystemConfigurationCheck_Report.htm
    Exception summary:
    The following is an exception stack listing the exceptions in outermost to innermost order
    Inner exceptions are being indented
    Exception type: System.NullReferenceException
        Message: 
            Object reference not set to an instance of an object.
        HResult : 0x80004003
        Data: 
          HelpLink.EvtType = 0x9AF1AE5E@0x44A889F9
          DisableWatson = true
        Stack: 
            at Microsoft.SqlServer.Configuration.RulesEngineExtension.RulesEngine.ShouldRuleRun(Rule rule)
            at Microsoft.SqlServer.Configuration.RulesEngineExtension.RulesEngine.IsRuleSkipped(Rule rule)
            at Microsoft.SqlServer.Configuration.RulesEngineExtension.RulesEngine.LoadRule(String ruleId, List`1 ruleProperties, XmlSchema ruleSchema, XmlElementParserFactory elementParser)
            at Microsoft.SqlServer.Configuration.RulesEngineExtension.RulesEngine.LoadRules(IEnumerable`1 ruleIds)
            at Microsoft.SqlServer.Configuration.InstallWizard.RunRuleProgressController.Initialize()

  • Slient install of Sql 2012 enterprise fails 'MEDIALAYOUT' is invalid"

    I'm trying to install SQL 2012 using the config file. It's failing and reporting 'MEDIALAYOUT' is invalid. The problem is that this isn't even a parmater that exists in the file. I know it's finding the file, because it I put a bogus file name there, it
    complains and says "invalid file". So i think it's reading the file, doesn't like something in there, then it kicks out this erroneous error that means nothing. I've looked in the event logs, see nothing.
    Has anybody seen this before? It not, is there any other log file I can look at that will tell me specifically what might be wrong?
    .\setup.exe \ConfigurationFile=ConfigurationFile.ini
    The specified value for setting 'MEDIALAYOUT' is invalid. The expected values are:None, Core, Advanced, Full
    THX

    Can you make sure that the config file is valid and comment lines are not text wrapped.
    FAQ
    Regards,
    Ahmed Ibrahim
    SQL Server Setup Team
    My Blog
    This posting is provided "AS IS" with no warranties, and confers no rights. Please remember to click
    "Mark as Answer" and "Vote as Helpful"
    on posts that help you.
    This can be beneficial to other community members reading the thread.

  • SQL 2012 install fails with 'Object reference not set to an instance of an object" On windows 8.1 Hyper-V

    Hi All,  
    Could you please help me here? On my Laptop which is running on windows 8.1 Operation system, I enabled the Hyper-V client feature and setup the Windows Fail-over Clustering using Windows 2012 Standard Edition. So, there are three machines which are running
    on the Hyper-V. Below are the machine details;
    1st machine - Working as Domain controller and its name is "ACONDomainGroup" and allocated to
    1GB RAM to use.
    2nd machine - Working as Node1 and its name is "AconNODE1W2K12STD"
    and allocated to 2.5GB RAM to use.
    3rd machine - Working as Node1 and its name is "AconNODE1W2K12STD"
    and allocated to 1.5GB RAM to use.
    and the windows virtual cluster name is "AconWinCLTR". While I am doing the SQL Cluster Installation, I am getting below mentioned error. all systems have 4.5 .net installed. May you please guide me where and what i am missing to complete sql clustering.....
      Update Source:                 MU
    User Input Settings:
      ACTION:                        InstallFailoverCluster
      AGTDOMAINGROUP:                <empty>
      AGTSVCACCOUNT:                 <empty>
      AGTSVCPASSWORD:                <empty>
      ASBACKUPDIR:                   Backup
      ASCOLLATION:                   Latin1_General_CI_AS
      ASCONFIGDIR:                   Config
      ASDATADIR:                     Data
      ASLOGDIR:                      Log
      ASPROVIDERMSOLAP:              1
      ASSERVERMODE:                  MULTIDIMENSIONAL
      ASSVCACCOUNT:                  <empty>
      ASSVCPASSWORD:                 <empty>
      ASSVCSTARTUPTYPE:              Automatic
      ASSYSADMINACCOUNTS:            <empty>
      ASTEMPDIR:                     Temp
      COMMFABRICENCRYPTION:          0
      COMMFABRICNETWORKLEVEL:        0
      COMMFABRICPORT:                0
      CONFIGURATIONFILE:             
      ENU:                           true
      ERRORREPORTING:                false
      FAILOVERCLUSTERDISKS:          <empty>
      FAILOVERCLUSTERGROUP:          
      FAILOVERCLUSTERIPADDRESSES:    <empty>
      FAILOVERCLUSTERNETWORKNAME:    <empty>
      FEATURES:                      
      FILESTREAMLEVEL:               0
      FILESTREAMSHARENAME:           <empty>
      FTSVCACCOUNT:                  <empty>
      FTSVCPASSWORD:                 <empty>
      HELP:                          false
      IACCEPTSQLSERVERLICENSETERMS:  false
      INDICATEPROGRESS:              false
      INSTALLSHAREDDIR:              C:\Program Files\Microsoft SQL
    Server\
      INSTALLSHAREDWOWDIR:           C:\Program Files (x86)\Microsoft SQL Server\
      INSTALLSQLDATADIR:             <empty>
      INSTANCEDIR:                   C:\Program Files\Microsoft
    SQL Server\
      INSTANCEID:                    <empty>
      INSTANCENAME:                  <empty>
      ISSVCACCOUNT:                  NT AUTHORITY\Network
    Service
      ISSVCPASSWORD:                 <empty>
      ISSVCSTARTUPTYPE:              Automatic
      MATRIXCMBRICKCOMMPORT:         0
      MATRIXCMSERVERNAME:            <empty>
      MATRIXNAME:                    <empty>
      PID:                           *****
      QUIET:                         false
      QUIETSIMPLE:                   false
      RSINSTALLMODE:                 DefaultNativeMode
      RSSHPINSTALLMODE:              DefaultSharePointMode
      RSSVCACCOUNT:                  <empty>
      RSSVCPASSWORD:                 <empty>
      RSSVCSTARTUPTYPE:              Automatic
      SAPWD:                         <empty>
      SECURITYMODE:                  <empty>
      SQLBACKUPDIR:                  <empty>
      SQLCOLLATION:                  SQL_Latin1_General_CP1_CI_AS
      SQLSVCACCOUNT:                 <empty>
      SQLSVCPASSWORD:                <empty>
      SQLSYSADMINACCOUNTS:           <empty>
      SQLTEMPDBDIR:                  <empty>
      SQLTEMPDBLOGDIR:               <empty>
      SQLUSERDBDIR:                  <empty>
      SQLUSERDBLOGDIR:               <empty>
      SQMREPORTING:                  false
      UIMODE:                        Normal
      UpdateEnabled:                 true
      UpdateSource:                  MU
      X86:                           false
      Configuration file:            C:\Program Files\Microsoft SQL Server\110\Setup
    Bootstrap\Log\20140420_052344\ConfigurationFile.ini
    Rules with failures:
    Global rules:
    There are no scenario-specific rules.
    Rules report file:               C:\Program Files\Microsoft SQL Server\110\Setup
    Bootstrap\Log\20140420_052344\SystemConfigurationCheck_Report.htm
    Exception summary:
    The following is an exception stack listing the exceptions in outermost to innermost order
    Inner exceptions are being indented
    Exception type: System.NullReferenceException
        Message: 
            Object reference not set to an instance of an object.
        HResult : 0x80004003
        Data: 
          HelpLink.EvtType = 0x9AF1AE5E@0x44A889F9
          DisableWatson = true
        Stack: 
            at Microsoft.SqlServer.Configuration.RulesEngineExtension.RulesEngine.ShouldRuleRun(Rule
    rule)
            at Microsoft.SqlServer.Configuration.RulesEngineExtension.RulesEngine.IsRuleSkipped(Rule
    rule)
            at Microsoft.SqlServer.Configuration.RulesEngineExtension.RulesEngine.LoadRule(String
    ruleId, List`1 ruleProperties, XmlSchema ruleSchema, XmlElementParserFactory elementParser)
            at Microsoft.SqlServer.Configuration.RulesEngineExtension.RulesEngine.LoadRules(IEnumerable`1
    ruleIds)
            at Microsoft.SqlServer.Configuration.InstallWizard.RunRuleProgressController.Initialize()

    Dharmendra, the log details are incomplete are not sufficient enough for I guess anyone to help. Besides, from the details above, I can see that the Failover Cluster Disks are not selected:-
    FAILOVERCLUSTERDISKS:          <empty>
      FAILOVERCLUSTERGROUP:          
      FAILOVERCLUSTERIPADDRESSES:    <empty>
      FAILOVERCLUSTERNETWORKNAME:    <empty>
    Please mark the answer as helpful if i have answered your query. Thanks and Regards, Kartar Rana

  • Unable to connect to SQL 2012 on Windows VM from gallery

    I had deployed new virtual machine from the gallery, windows 2012 with sql 2012 but fail to login with default authentication
    I had followed the directions as in: "Provisioning a SQL Server Virtual Machine on Windows Azure"  (http://www.windowsazure.com/en-us/documentation/articles/virtual-machines-provision-sql-server/)
     but fail to login to SQL with the following error:
    ===================================
    Cannot connect to R10PROJDEPLOY.
    ===================================
    Login failed for user 'R10PROJDEPLOY\R10Admin'. (.Net SqlClient Data Provider)
    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=18456&LinkId=20476
    Server Name: R10PROJDEPLOY
    Error Number: 18456
    Severity: 14
    State: 1
    Line Number: 65536
    in the past I had used same procedure to work with windows Server 2008 & SQL 2008 and managed to login well, any hint could be wrong?

    Hi,
    To connect to the Database Engine from another computer, configure SQL Server for mixed mode authentication.
    Add the port number after the server name.
    Also try connecting with the IP address.
    If no progress, please check the error message in ‘\Program Files\Microsoft SQL Server\MSSQL11.<instance name> \MSSQL\Log\ERRORLOG’
    Hope it helps.
    Tracy Cai
    TechNet Community Support

  • Failed to install ms sql 2012, it shows 1406 Could not write value to key \SOFTWARE. Verify that you have sufficient access to that key, or contact your support personnel. error

    Hi friends,
    i have tried to install ms sql 2012 on windows 8.1 pro 64 bit  but it got failed due to the following error 1406 Could not write value  to key \SOFTWARE.   Verify that you have sufficient access to that key, or contact your support personnel.. 
     I had run the set up file as administrator. I have ony one user account on my laptop. I have seen in the regestry about permission of user. There is full control to the user. I have also tried the solution related to this issue that are available in
    this forum and other.
    I have also attache the detail.txt log file here
    So i am heartily requesting you guys if you have the solution then please post your solution as soon as possible. 
    Thanks in  advance!!!

    Looks like this is a permission issue with account you logged in in your operating system or account if any you chooses to run you SQL Server installation . Or for executing setup file try using run as administrator.
    http://www.sperrysoftware.com/kb/questions/7/How+to+Troubleshoot+a+%22Error+1406%3A+Could+not+write+value...%22+or+%22Error+1406%3A+Could+not+write+InstanceIndex+to+key...%22+error+message
    http://support.microsoft.com/kb/913559
    Raju Rasagounder Sr MSSQL DBA

  • SQL 2012 enterprise service pack 2 fails to install

    Hi,
    I have installed SQL 2012 sp2 x64 onto the main service manager 2012 database, but it fails on the datawarehouse SQL server. Both are going from SP1 to SP2. Servers are running windows server 2012 sp1 x64.
    On the datawarehouse server it gets so far and then just displays a message of completed, with all the other fields blank.
    The text file for the Summary of the installation has been copied below:
    Overall summary:
      Final result:                  The patch installer has failed to update the following instance: MSSQLSERVER. To determine the reason for failure, review the log files.
      Exit code (Decimal):           -2068709375
      Start time:                    2015-01-09 13:55:32
      End time:                      2015-01-09 14:04:09
      Requested action:              Patch
    Instance MSSQLSERVER overall summary:
      Final result:                  The patch installer has failed to update the shared features. To determine the reason for failure, review the log files.
      Exit code (Decimal):           -2068709375
      Exit facility code:            1202
      Exit error code:               1
      Exit message:                  The NT service 'MSSQLServerOLAPService' could not be stopped.
      Start time:                    2015-01-09 14:00:18
      End time:                      2015-01-09 14:04:01
      Requested action:              Patch
      Exception help link:          
    http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.5058.0&EvtType=0xAC454CB1%400xF762992B%401202%401&EvtType=0xAC454CB1%400xF762992B%401202%401
    Machine Properties:
      Machine name:                  SCSDWM01
      Machine processor count:       4
      OS version:                    Future Windows Version
      OS service pack:              
      OS region:                     United Kingdom
      OS language:                   English (United States)
      OS architecture:               x64
      Process architecture:          64 Bit
      OS clustered:                  No
    Product features discovered:
      Product              Instance             Instance ID                   
    Feature                                  Language            
    Edition              Version         Clustered  Configured
      SQL Server 2012      MSSQLSERVER          MSSQL11.MSSQLSERVER            Database Engine Services                
    1033                 Enterprise Edition   11.1.3153.0     No         Yes      
      SQL Server 2012      MSSQLSERVER          MSSQL11.MSSQLSERVER            Full-Text and Semantic Extractions for Search 1033                
    Enterprise Edition   11.1.3000.0     No         Yes      
      SQL Server 2012      MSSQLSERVER          MSAS11.MSSQLSERVER             Analysis Services                       
    1033                 Enterprise Edition   11.1.3130.0     No         Yes      
      SQL Server 2012      MSSQLSERVER          MSRS11.MSSQLSERVER             Reporting Services - Native             
    1033                 Enterprise Edition   11.1.3153.0     No         Yes      
      SQL Server 2012                                                         
    Management Tools - Basic                 1033                 Enterprise Edition   11.1.3153.0    
    No         Yes      
      SQL Server 2012                                                         
    Management Tools - Complete              1033                 Enterprise Edition   11.1.3130.0    
    No         Yes      
      SQL Server 2012                                                         
    SQL Server Data Tools - Business Intelligence for Visual Studio 2012 1033                                     
    11.1.3402.0     No         Yes      
      SQL Server 2012                                                         
    Integration Services                     1033                 Enterprise Edition  
    11.1.3153.0     No         Yes      
    Package properties:
      Description:                   Microsoft SQL Server 2012
      ProductName:                   SQL Server 2012
      Type:                          RTM
      Version:                       11
      SPLevel:                       2
      KBArticle:                     KB2958429
      KBArticleHyperlink:           
    http://support.microsoft.com/?kbid=2958429
      PatchType:                     SP
      AssociatedHotfixBuild:         0
      Platform:                      x64
      PatchLevel:                    11.2.5058.0
      ProductVersion:                11.0.2100.60
      GDRReservedRange:              11.0.5300.0:11.0.5499.0
      PackageName:                   SQLServer2012-KB2958429-x64.exe
      Installation location:         c:\ce370c3d01e3ec4095540d8578cc7e\x64\setup\
    Updated product edition:
      Instance             Edition            
      MSSQLSERVER          Enterprise         
    User Input Settings:
      ACTION:                        Patch
      ALLINSTANCES:                  false
      CLUSTERPASSIVE:                false
      CONFIGURATIONFILE:            
      ENU:                           false
      HELP:                          false
      IACCEPTSQLSERVERLICENSETERMS:  true
      INDICATEPROGRESS:              false
      INSTANCEID:                    <empty>
      INSTANCENAME:                  <empty>
      QUIET:                         false
      QUIETSIMPLE:                   false
      SQMREPORTING:                  false
      UIMODE:                        Normal
      X86:                           false
    Rules with failures:
    Global rules:
    There are no scenario-specific rules.
    Rules report file:               C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20150109_135509\SystemConfigurationCheck_Report.htm
    Any ideas on why this has happened and how to fix the error?
    Thanks.
    Jaz

    Hello,
    Open the errorlog file on the following path C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Log. There
    you will find a more descriptive error.
    I received that error before. The workaround I used is contained on the following article:
    http://www.sqlcoffee.com/Troubleshooting112.htm
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • SQL 2012 installation for Failover Cluster failed

    While installation of SQL 2012 on FOC validation fails on "Database Engine configuration" page with following error:
    The volume that contains SQL Server data directory g:\MSSQL11.MSSQLSERVER\MSSQL\DATA does not belong to the cluster group.
    Want to know how does SQL installation wizard queries volumes configured with Failover Cluster. does it:
    - Enumerate "Physical Disk" resources in FOC
    - does it enumerate all Storage Class resources in FOC for getting the volume list
    - or it depends on WMI (Win32_Volume) to get volumes ?
    The wizard correctly discovers volume g:\ in its FOC group on "Cluster Resource Group" and "Cluster Disk Selection" page. but gives the error on Database configuration page.
    Any help in this would be appreciated.
    Thanks in advance
    Rakesh
    Rakesh Agrawal

    Can you please check if there is any disk in the cluster which is not in online state? Please run below script following the steps.
    1. Save a script as "Disk.vbs" and use
    use CSCRIPT to run it.
    2. Syntax: CSCRIPT <Disk.vbs> <Windows Cluster Name>
    < Script>
    Option Explicit
    Public objArgs, objCluster
    Public Function Connect()
    ' Opens a global cluster object. Using Windows Script Host syntax,
    ' the cluster name or "" must be passed as the first argument.
    Set objArgs = WScript.Arguments
    if objArgs.Count=0  then
     wscript.Echo "Usage Cscript  <script file name>  <Windows Cluster Name> "
     WScript.Quit
    end IF
    Set objCluster = CreateObject("MSCluster.Cluster")
    objCluster.Open objArgs(0)
    End Function
    Public Function Disconnect()
    ' Dereferences global objects.  Used with Connect.
     Set objCluster = Nothing
     Set objArgs = Nothing
    End Function
    Connect
    Dim objEnum
    For Each objEnum in objCluster.Resources
     If objEnum.ClassInfo = 1 Then
      WScript.Echo ObjEnum.Name
      Dim objDisk
      Dim objPartition
      On Error Resume Next
       Set objDisk = objEnum.Disk
       If Err.Number <> 0 Then
        WScript.Echo "Unable to retrieve the disk: " & Err
       Else
        For Each objPartition in objDisk.Partitions
         WScript.Echo objPartition.DeviceName
        Next
       End If
     End If
    Next
    Disconnect
    </Script>

  • SQL 2012 - SSIS Error -The step did not generate any output. The return value was unknown. The process exit code was -1073741819. The step failed.

    Hi guys 
     Trying to run this package on SQL 2012 agent  and getting below error . No more details I could find so far.
    The step did not generate any output.  The return value was unknown.  The process exit code was -1073741819.  The step failed.
    About Package - Its connecting to different version (2000,2005,2008,2008R2,2012) servers and putting Jobs information into one Database table.  
    Any workaround or fix ?
    Thanks
    Please Mark As Answer if it is helpful. \\Aim To Inspire Rather to Teach

    New package or one that used to work? Connecting how? How does it poll?
    On the surface it is an error from a memory space of the binary/non-managed code, so nothing can be really concluded based on what you decided to share with us.
    Arthur My Blog
    So Same package is working fine from my local machine which has SQL 2008 R2 and SQL 2012 installed. I am trying to push the package on server which has sql server 2012 Installed . 
    I don't see any error .
    I ran package manually from server using SQL Data tools and ran successfully...
    Please Mark As Answer if it is helpful. \\Aim To Inspire Rather to Teach

  • SQL Server 2012 syspolicy_purge_history fails step 3 "Erase Phantom System Health Records."

    I recently installed SQL Server 2012 Ent (x64). The install is a stand alone default instance.
    The syspolicy_purge_history job fails on step three with the following error:
    Executed as user: <DomainName>\sql_xxx_agt_svc. A job step received an error at line 1 in a PowerShell script. The corresponding line is 'set-executionpolicy RemoteSigned -scope process -Force'. Correct the script and reschedule the job. The error
    information returned by PowerShell is: 'Security error.  '.  Process Exit Code -1.  The step failed.
    Here is the code that is in the step:
    if ('$(ESCAPE_SQUOTE(INST))' -eq 'MSSQLSERVER') {$a = '\DEFAULT'} ELSE {$a = ''};
    (Get-Item SQLSERVER:\SQLPolicy\$(ESCAPE_NONE(SRVR))$a).EraseSystemHealthPhantomRecords()
    The domain user is the account that SQL Agent is running as.
    What permissions need to be granted to this account?
    Here is the link to the Connect post:
    https://connect.microsoft.com/SQLServer/feedback/details/754063/sql-server-2012-syspolicy-purge-history-job-step-3-fails-with-security-error

    I'm putting this in the connect post as well, but putting here in case somoene else comes across it.
    I was having the same problem with the syspolicy_purge_history job right after a standalone SQL 2012 (with SP1 and cu4,
    11.0.3368.0 (X64)) install that happened to be on a cluster but was not going to be a clustered instance. After trying all the different suggestions here around the ExecutionPolicy, I was still getting nowhere.
    Turns out, having a named isntance with a static port number and the SQL Browser service disabled was causing my problems. Apparently that was not allowing PowerShell to find the SQL instance. When I would navigate the SQLSERVER:\SQLPolicy folder
    in PowerShell (sqlps), I could get to the server root, but not the instance. If I even tried to list the subdirectories under the server folder, I would get an error:
    PS SQLSERVER:\> cd .\SQLPolicy\SRVR
    PS SQLSERVER:\SQLPolicy\SRVR> ls
    WARNING: 'INST' not available: Failed to connect to server. --> A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
    PS SQLSERVER:\SQLPolicy\SRVR> cd .\INST
    cd : Failed to connect to server .
    At line:1 char:3
    + cd <<<< .\INST
    + CategoryInfo : NotSpecified: (:) [Set-Location], ConnectionFailureException
    + FullyQualifiedErrorId : Microsoft.SqlServer.Management.Common.ConnectionFailureException,Microsoft.PowerShell.Commands.SetLocationCommand
    To solve this issue, I had to open SQL Server Configuration Manager and create an alias under the SQL Native Client 11.0 Configuration (I didn't need to set the 32-bit one):
    Alias
    [server name]\[instance name]
    Port
    [my static port]
    Protocol
    TCP/IP
    Server
    [server name]\[instance name]
    Once this was done, I was able to set the ExecutionPolicy registry settings, and the job completed. Here are my registry settings:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell\ExecutionPolicy = Restricted
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.SqlServer.Management.PowerShell.sqlps110\ExecutionPolicy = RemoteSigned
    From PowerShell (as Admin):
    PS C:\Windows\system32> Get-ExecutionPolicy -list
    Scope ExecutionPolicy
    MachinePolicy Undefined
    UserPolicy Undefined
    Process Undefined
    CurrentUser Undefined
    LocalMachine Restricted
    PS SQLSERVER:\> Get-ExecutionPolicy -list
    Scope ExecutionPolicy
    MachinePolicy Undefined
    UserPolicy Undefined
    Process RemoteSigned
    CurrentUser Undefined
    LocalMachine Restricted

  • MDW Upload failing on SQL 2012

    I've configured MDW data collection job on SQL 2012 server and the repository server is on SQL 2008 server. But the Upload job is failing on login failure error. The SQl 2012 agent job is taking domain\servername$ to run the job, even i change the account
    to another domain account, it still uses the same account to connect. 
    Is this expected behavior? is there any workaround?
    Thanks
    Jay

    Hi Jay,
    According to your description, you can post the error messages for analysis. In addition, it seems that your SQL Server Agent account (domain\servername$) on SQL Server 2012 has no privileges to access the Management Data Warehouse (MDW) database. By default
    the data collection upload job will run as the SQL Server Agent account, you need to make sure that the SQL Server Agent account has access to the MDW database if it has been configured on a remote server. To ensure this access, you can create a
    SQL Server Agent proxy account and add it to the dc_proxy database role for the msdb database.
    For more details, please review the following link:
    SQL Server 2008 Management Data Warehouse:
    http://msdn.microsoft.com/en-us/library/dd939169(v=sql.100).aspx
    Thanks
    Lydia Zhang

  • SQL 2012 DB Engine [Login failed: Account locked out] alerts not received from SCOM 2007 R2

    Dear Experts,
    In our SCOM 2007 R2 environment SQL 2012 DB Engine [Login failed: Account locked out] alerts not received but we are receiving the following alerts fr the DB instance.
    1. Database Backup Failed To Complete
    2. Login failed: Password expired
    3. Log Backup Failed to Complete
    4. Login failed: Password cannot be used at this time
    5. Login failed: Password must be changed
    6. IS Package Failed.
    Why we are not receiving the "Login failed: Account locked out" ? Customers are asking the notification email alert for this Rule even I have checked the override settings everything is enabled by default same as above rules.
    What can be the issue here ?
    Thanks,
    Saravana
    Saravana Raja

    Hi,
    Could you please check the Windows security log for (MSSQLSERVER) event ID 18486? The rule should rely on this event.
    Regards,
    Yan Li
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • SQL 2012 and later will fail to publish a database for any tables with a default constraint that references a user defined function.

    Script will create database, 3 database objects and publish. 
    The error is due to the generation script to create the conflict tables that is not stripping out default constraints that reference a UDF. 
    As you can see below, the failure is on the generation script for the conflict table.
    The conflict table should be a bucket table that shouldn’t enforce data integrity. 
    See how the default constraints for the columns someint and somestring were stripped out of the generation logic however the default constraint that utilizes a UDF persist and uses the same object name that was used on the production table (The
    bold line) , this occurs if I explicitly name the constraint or let the system generate the name for me like in the example posted. 
      The only way I could see getting around this right now is to drop all default constraints in the system that uses a UDF, publish then add the constraints back which is vulnerable to invalid data and a lot of moving
    steps.  This all worked with SQL 2000, 2005, 2008, 2008r2, it’s stopped working in SQL 2012 and continues to not work in SQL 2014. 
    Error messages:
    Message: There is already an object named 'DF__repTable__id__117F9D94' in the database.
    Could not create constraint. See previous errors.
    Command Text: CREATE TABLE [dbo].[MSmerge_conflict_MergeRepFailurePublication_repTable](
            [id] [varchar](8) NULL CONSTRAINT [DF__repTable__id__117F9D94]  DEFAULT ([dbo].[repUDF]()),
            [somedata] [varchar](64) NULL,
            [rowguid] [uniqueidentifier] ROWGUIDCOL  NULL,
            [someint] [int] NULL,
            [somestring] [varchar](64) NULL
    Parameters:
    Stack:    at Microsoft.SqlServer.Replication.AgentCore.ReMapSqlException(SqlException e, SqlCommand command)
       at Microsoft.SqlServer.Replication.AgentCore.AgentExecuteNonQuery(SqlCommand command, Int32 queryTimeout)
       at Microsoft.SqlServer.Replication.AgentCore.ExecuteDiscardResults(CommandSetupDelegate commandSetupDelegate, Int32 queryTimeout)
       at Microsoft.SqlServer.Replication.Snapshot.YukonMergeConflictTableScriptingManager.ApplyBaseConflictTableScriptToPublisherIfNeeded(String strConflictScriptPath)
       at Microsoft.SqlServer.Replication.Snapshot.BaseMergeConflictTableScriptingManager.DoConflictTableScriptingTransaction(SqlConnection connection)
       at Microsoft.SqlServer.Replication.RetryableSqlServerTransactionManager.ExecuteTransaction(Boolean bLeaveTransactionOpen)
       at Microsoft.SqlServer.Replication.Snapshot.BaseMergeConflictTableScriptingManager.DoConflictTableScripting()
       at Microsoft.SqlServer.Replication.Snapshot.MergeSmoScriptingManager.GenerateTableArticleCftScript(Scripter scripter, BaseArticleWrapper articleWrapper, Table smoTable)
       at Microsoft.SqlServer.Replication.Snapshot.MergeSmoScriptingManager.GenerateTableArticleScripts(ArticleScriptingBundle articleScriptingBundle)
       at Microsoft.SqlServer.Replication.Snapshot.MergeSmoScriptingManager.GenerateArticleScripts(ArticleScriptingBundle articleScriptingBundle)
       at Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.GenerateObjectScripts(ArticleScriptingBundle articleScriptingBundle)
       at Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.DoScripting()
       at Microsoft.SqlServer.Replication.Snapshot.SqlServerSnapshotProvider.DoScripting()
       at Microsoft.SqlServer.Replication.Snapshot.MergeSnapshotProvider.DoScripting()
       at Microsoft.SqlServer.Replication.Snapshot.SqlServerSnapshotProvider.GenerateSnapshot()
       at Microsoft.SqlServer.Replication.SnapshotGenerationAgent.InternalRun()
       at Microsoft.SqlServer.Replication.AgentCore.Run() (Source: MSSQLServer, Error number: 2714)
    Get help: http://help/2714
    Server COL-PCANINOW540\SQL2012, Level 16, State 0, Procedure , Line 1
    Could not create constraint. See previous errors. (Source: MSSQLServer, Error number: 1750)
    Get help: http://help/1750
    Server COL-PCANINOW540\SQL2012, Level 16, State 0, Procedure , Line 1
    Could not create constraint. See previous errors. (Source: MSSQLServer, Error number: 1750)
    Get help: http://help/1750
    Pauly C
    USE [master]
    GO
    CREATE DATABASE [MergeRepFailure]
    ALTER DATABASE [MergeRepFailure] SET COMPATIBILITY_LEVEL = 110
    GO
    USE [MergeRepFailure]
    GO
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    create view
    [dbo].[repView] as select right(newid(),8) as id
    GO
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE FUNCTION [dbo].[repUDF]()
    RETURNS varchar(8)
    BEGIN
    declare @val varchar(8)
    select top 1 @val = id from [repView]
    return @val
    END
    GO
    create table repTable
    id varchar(8) default([dbo].[repUDF]()),
    somedata varchar(64) null,
    rowguid uniqueidentifier ROWGUIDCOL default(newid()),
    someint int default(1),
    somestring varchar(64) default('somestringvalue')
    GO
    insert into reptable (somedata) values ('whatever1')
    insert into reptable (somedata) values ('whatever2')
    go
    /*test to make sure function is working*/
    select * from reptable
    GO
    /*Publish database*/
    use [MergeRepFailure]
    exec sp_replicationdboption @dbname = N'MergeRepFailure', @optname = N'merge publish', @value = N'true'
    GO
    declare @Descrip nvarchar(128)
    select @Descrip = 'Merge publication of database ''MergeRepFailure'' from Publisher ''' + @@servername +'''.'
    print @Descrip
    -- Adding the merge publication
    use [MergeRepFailure]
    exec sp_addmergepublication @publication = N'MergeRepFailurePublication', @description = N'@Descrip',
    @sync_mode = N'native', @retention = 14, @allow_push = N'true', @allow_pull = N'true', @allow_anonymous = N'true',
    @enabled_for_internet = N'false', @snapshot_in_defaultfolder = N'true', @compress_snapshot = N'false', @ftp_port = 21,
    @ftp_subdirectory = N'ftp', @ftp_login = N'anonymous', @allow_subscription_copy = N'false', @add_to_active_directory = N'false',
    @dynamic_filters = N'false', @conflict_retention = 14, @keep_partition_changes = N'false', @allow_synctoalternate = N'false',
    @max_concurrent_merge = 0, @max_concurrent_dynamic_snapshots = 0, @use_partition_groups = null, @publication_compatibility_level = N'100RTM',
    @replicate_ddl = 1, @allow_subscriber_initiated_snapshot = N'false', @allow_web_synchronization = N'false', @allow_partition_realignment = N'true',
    @retention_period_unit = N'days', @conflict_logging = N'both', @automatic_reinitialization_policy = 0
    GO
    exec sp_addpublication_snapshot @publication = N'MergeRepFailurePublication', @frequency_type = 4, @frequency_interval = 14, @frequency_relative_interval = 1,
    @frequency_recurrence_factor = 0, @frequency_subday = 1, @frequency_subday_interval = 5, @active_start_time_of_day = 500, @active_end_time_of_day = 235959,
    @active_start_date = 0, @active_end_date = 0, @job_login = null, @job_password = null, @publisher_security_mode = 1
    use [MergeRepFailure]
    exec sp_addmergearticle @publication = N'MergeRepFailurePublication', @article = N'repTable', @source_owner = N'dbo', @source_object = N'repTable', @type = N'table',
    @description = null, @creation_script = null, @pre_creation_cmd = N'drop', @schema_option = 0x000000010C034FD1, @identityrangemanagementoption = N'manual',
    @destination_owner = N'dbo', @force_reinit_subscription = 1, @column_tracking = N'false', @subset_filterclause = null, @vertical_partition = N'false',
    @verify_resolver_signature = 1, @allow_interactive_resolver = N'false', @fast_multicol_updateproc = N'true', @check_permissions = 0, @subscriber_upload_options = 0,
    @delete_tracking = N'true', @compensate_for_errors = N'false', @stream_blob_columns = N'false', @partition_options = 0
    GO
    use [MergeRepFailure]
    exec sp_addmergearticle @publication = N'MergeRepFailurePublication', @article = N'repView', @source_owner = N'dbo', @source_object = N'repView',
    @type = N'view schema only', @description = null, @creation_script = null, @pre_creation_cmd = N'drop', @schema_option = 0x0000000008000001,
    @destination_owner = N'dbo', @destination_object = N'repView', @force_reinit_subscription = 1
    GO
    use [MergeRepFailure]
    exec sp_addmergearticle @publication = N'MergeRepFailurePublication', @article = N'repUDF', @source_owner = N'dbo', @source_object = N'repUDF',
    @type = N'func schema only', @description = null, @creation_script = null, @pre_creation_cmd = N'drop', @schema_option = 0x0000000008000001,
    @destination_owner = N'dbo', @destination_object = N'repUDF', @force_reinit_subscription = 1
    GO

    More information, after running a profile trace the following 2 statements, the column with the default on a UDF returns a row while the other default does not.  This might be the cause of this bug.  Is the same logic to generate the object on
    the subscriber used to generate the conflict table?  
    exec sp_executesql N'
    select so.name, schema_name(so.schema_id)
    from sys.sql_dependencies d
    inner join sys.objects so
    on d.referenced_major_id = so.object_id
    where so.type in (''FN'', ''FS'', ''FT'', ''TF'', ''IF'')
    and d.class in (0,1)
    and d.referenced_major_id <> object_id(@base_table, ''U'')
    and d.object_id = object_id(@constraint, ''D'')',N'@base_table nvarchar(517),@constraint nvarchar(517)',@base_table=N'[dbo].[repTable]',@constraint=N'[dbo].[DF__repTable__id__117F9D94]'
    exec sp_executesql N'
    select so.name, schema_name(so.schema_id)
    from sys.sql_dependencies d
    inner join sys.objects so
    on d.referenced_major_id = so.object_id
    where so.type in (''FN'', ''FS'', ''FT'', ''TF'', ''IF'')
    and d.class in (0,1)
    and d.referenced_major_id <> object_id(@base_table, ''U'')
    and d.object_id = object_id(@constraint, ''D'')',N'@base_table nvarchar(517),@constraint nvarchar(517)',@base_table=N'[dbo].[repTable]',@constraint=N'[dbo].[DF__repTable__somein__1367E606]'
    Pauly C

  • Upgrading DPM 2012 SP1 to DPM 2012 R2 fails (DPM Setup is unable to connect to the specific instance of SQL Server Reporting Service (ID: 33431)

    The Background:
    1.  DPM 2012 SP1 was originally installed on a server with local SQL 2008 R2 instance (SQL was installed as part of DPM)
    2.  SQL database was upgraded to SQL 2012 SP1
    Now I want to upgrade DPM 2012 SP1 CU3 to R2.  It is throwing the following error.  Any help would be appreciated. 

    This absolutely fixed my issue.  I had upgraded my version of SQL and was then trying to upgrade DPM 2012 to 2012R2 and I could not figure out where the installation was querying old version of the reporting services.
    DPM Log Before:
    [6/4/2014 2:53:32 PM] Information : Query WMI provider for path of configuration file for SQL Server 2008 Reporting Services.
    [6/4/2014 2:53:32 PM] Information : Querying WMI Namespace: \\DPMServer\root\Microsoft\SqlServer\ReportServer\RS_MSDPM2012\v10\admin for query: SELECT * FROM MSReportServer_ConfigurationSetting WHERE InstanceName='MSDPM2012'
    [6/4/2014 2:53:32 PM] * Exception :  => System.Management.ManagementException: Provider load failure
    DPM Log After:
    [6/4/2014 3:25:36 PM] Information : SQL Server 2008 R2 SP2 instance MSDPM2012 is not present on this system.
    [6/4/2014 3:25:36 PM] Information : Query WMI provider for SQL Server 2008.
    [6/4/2014 3:25:36 PM] Information : Querying WMI Namespace: \\DPMServer\root\Microsoft\SqlServer\ComputerManagement11 for query: Select * from SqlServiceAdvancedProperty where ServiceName='MSSQL$MSDPM2012' and PropertyName='Version'
    [6/4/2014 3:25:36 PM] Information : SQL Server 2008 R2 SP2 instance MSDPM2012 is present on this system.
    [6/4/2014 3:25:36 PM] Information : Inspect context initialized with
    SQL Server namespace: \\{0}\root\Microsoft\SqlServer\ComputerManagement11
    Reporting namespace: \\{0}\root\Microsoft\SqlServer\ReportServer\RS_{1}\v11\admin
    SqlServerDetected: True
    [6/4/2014 3:25:36 PM] Information : Check if SQL Server 2012 Service Pack 1 Tools is installed.
    [6/4/2014 3:25:36 PM] Information : Inspect.CheckSqlServerTools : MsiQueryProductState returned : INSTALLSTATE_DEFAULT
    [6/4/2014 3:25:36 PM] Information : **********************************************************************************
    Thanks for This FIX!

Maybe you are looking for

  • How to upload more than 100mb in using com.oreilly.servlet package

    hi all, I use com.oreilly.servlet package to upload and i use the following code to upload MultipartRequest mr = new MultipartRequest(request,"/tmp/saved",0x10000000);My problem is i can't upload more than 25mb, uploads upto 25mb and shows page canno

  • REPOST -Summarizing a Detailed Debtors Aging Report

    Dear All, I use a Query (SAP B1 8.8) for Detailed Debtors Aging Report - i.e a report which lists all unpaid invoices and sends each amount to a column representing the age bracket. Now, I want to create a Summary Debtors Aging Report which groups al

  • SQL Question - Escaping values

    I am using java.sql and need to do a simple "insert into ..." command. The problem is i can not find a escape funtion.. or anything in the package that will escape the characters that need to be escaped. ex of what i need: statement.executeUpdate("IN

  • ButtonCombo in Screen Painter

    Dear All, Is it possible to add Buttoncombo same as CopyTo & CopyFrom button on Customized form.

  • IPhoto 08 Web Gallery Auto-resize?

    I am using iPhoto 08 to create a Web Gallery but have very large photo files. Does iPhoto upload at the original file size or does it automatically scale down to sizes more appropriate for web viewing? I want to ensure people can download photos from