SQL 2012 Copy Database Wizard fails

I am trying to use the Copy Database Wizard in SQL Server 2012
The host is running SQL Server 2000 (8.00.2066 (SP4)) on a Windows 2003 server
The destination is SQL Server 2012 running on Windows Server 2012 Standard.
Its gets to Execute SQL Server Agent Job and fails with this error:
The job failed. Check the event log on the destination server for details
Fails at – Execute SQL Server Agent Job
I've looked at the application log and not sure which errors are relevant. Here are two of them:
the first is an error, the second a warning.
Log Name:      Application
Source:        SQLISPackage110
Date:          1/9/2015 11:39:24 AM
Event ID:      12291
Task Category: None
Level:         Error
Keywords:      Classic
User:          NT SERVICE\SQLSERVERAGENT
Computer:      SQL2013
Description:
Package "CDW_SQL_SQL2013_7" failed.
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="SQLISPackage110" />
    <EventID Qualifiers="16385">12291</EventID>
    <Level>2</Level>
    <Task>0</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2015-01-09T16:39:24.000000000Z" />
    <EventRecordID>456924</EventRecordID>
    <Channel>Application</Channel>
    <Computer>SQL2013</Computer>
    <Security UserID="S-1-5-80-344959196-2060754871-2302487193-2804545603-1466107430" />
  </System>
  <EventData>
    <Data>CDW_SQL_SQL2013_7</Data>
  </EventData>
</Event>
Log Name:      Application
Source:        SQLSERVERAGENT
Date:          1/9/2015 11:39:26 AM
Event ID:      208
Task Category: Job Engine
Level:         Warning
Keywords:      Classic
User:          N/A
Computer:      SQL2013
Description:
SQL Server Scheduled Job 'CDW_SQL_SQL2013_7_1' (0xDFA5EEDDB2D53A4FB3C7CED04563896E) - Status: Failed - Invoked on: 2015-01-09 11:39:18 - Message: The job failed.  The Job was invoked by User VGBtR3r0WgKjvthk.  The last step to run was step 1 (CDW_SQL_SQL2013_7_1_Step).
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="SQLSERVERAGENT" />
    <EventID Qualifiers="16384">208</EventID>
    <Level>3</Level>
    <Task>3</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2015-01-09T16:39:26.000000000Z" />
    <EventRecordID>456927</EventRecordID>
    <Channel>Application</Channel>
    <Computer>SQL2013</Computer>
    <Security />
  </System>
  <EventData>
    <Data>CDW_SQL_SQL2013_7_1</Data>
    <Data>0xDFA5EEDDB2D53A4FB3C7CED04563896E</Data>
    <Data>Failed</Data>
    <Data>2015-01-09 11:39:18</Data>
    <Data>The job failed.  The Job was invoked by User VGBtR3r0WgKjvthk.  The last step to run was step 1 (CDW_SQL_SQL2013_7_1_Step).</Data>
  </EventData>
</Event>
Any ideas would be appreciated. I'm anxious to retire this old SQL 2000 server!
Mike

Thanks David.
is this the log you are looking for:
Date  1/9/2015 11:39:18 AM
Log  Job History (CDW_SQL_SQL2013_7_1)
Step ID  1
Server  SQL2013
Job Name  CDW_SQL_SQL2013_7_1
Step Name  CDW_SQL_SQL2013_7_1_Step
Duration  00:00:08
Sql Severity 0
Sql Message ID 0
Operator Emailed 
Operator Net sent 
Operator Paged 
Retries Attempted 0
Message
Executed as user: NT Service\SQLSERVERAGENT. Microsoft (R) SQL Server Execute Package Utility  Version 11.0.2100.60 for 64-bit  Copyright (C) Microsoft Corporation. All rights reserved.    Started:  11:39:18 AM  Progress:
2015-01-09 11:39:18.61     Source: sql_SQL2013_Transfer Objects Task      Task just started the execution.: 0% complete  End Progress  Error: 2015-01-09 11:39:24.50     Code: 0x00000000    
Source: sql_SQL2013_Transfer Objects Task      Description: An error occurred while transferring data. See the inner exception for details.  StackTrace:    at Microsoft.SqlServer.Management.Smo.Transfer.TransferData()    
at Microsoft.SqlServer.Dts.Tasks.TransferObjectsTask.TransferObjectsTask.TransferExtraObjectsViaSmoTransfer()  InnerException-->The specified schema name "INFORMATION_SCHEMA" either does not exist or you do not have permission to use it. 
StackTrace:    at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)     at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)     at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject
stateObj, Boolean& dataReady)     at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)     at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1
completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)     at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()     at Microsoft.SqlServer.Management.Smo.Transfer.ExecuteStatements(SqlConnection
destinationConnection, IEnumerable`1 statements, SqlTransaction transaction)     at Microsoft.SqlServer.Management.Smo.Transfer.TransferData()  End Error  Progress: 2015-01-09 11:39:24.50     Source: sql_SQL2013_Transfer
Objects Task      Database transfer failed for one or more extra objects.: 0% complete  End Progress  Progress: 2015-01-09 11:39:24.50     Source: sql_SQL2013_Transfer Objects Task     
Transfer objects finished execution.: 100% complete  End Progress  Warning: 2015-01-09 11:39:24.52     Code: 0x80019002     Source: CDW_SQL_SQL2013_7      Description: SSIS Warning
Code DTS_W_MAXIMUMERRORCOUNTREACHED.  The Execution method succeeded, but the number of errors raised (1) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change
the MaximumErrorCount or fix the errors.  End Warning  DTExec: The package execution returned DTSER_FAILURE (1).  Started:  11:39:18 AM  Finished: 11:39:24 AM  Elapsed:  6.062 seconds.  The package execution failed. 
The step failed.
I will also look into backup/restore. Will that work between 2000 and 2012?

Similar Messages

  • Copy Database Wizard error: Enumerate subsystems failed for JobServer

    Hi, non-SQL person looking for some guidance. I'm trying to copy databases with permissions from a Win2008 server with SQL2008R2 to a Win2012 server with SQL2012. I'm running SSMS on the 2012 instance, and intiating the Copy Wizard from there. I'm getting
    the following error. Thanks.
    TITLE: Copy Database Wizard
    Enumerate subsystems failed for JobServer 'Win2012serverSQL2012'.
    For help, click:
    http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=11.0.3401.0+((SQL11_SP1_QFE-CU).140109-1303+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Enumerate+subsystems+JobServer&LinkId=20476
    ADDITIONAL INFORMATION:
    An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
    The EXECUTE permission was denied on the object 'sp_enum_sqlagent_subsystems', database 'msdb', schema 'dbo'. (Microsoft SQL Server, Error: 229)
    For help, click:
    http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=11.00.3401&EvtSrc=MSSQLServer&EvtID=229&LinkId=20476

    TITLE: Copy Database Wizard
    Create failed for JobStep 'NAME_CDW_2008ServerName_Win2012serverSQL2012'.
    For help, click:
    http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.4000.0+((KJ_PCU_Main).120628-0827+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Create+JobStep&LinkId=20476
    ADDITIONAL INFORMATION:
    An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
    The @flags parameter is not valid for a job step of type 'SSIS'. (Microsoft SQL Server, Error: 14545)
    For help, click:
    http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=11.00.3401&EvtSrc=MSSQLServer&EvtID=14545&LinkId=20476
    BUTTONS:
    OK
    Hi scogordo,
    From your description, are you using SSMS 2008 R2 to perform the copy action?  I make a test on my computer, and get the same error as yours. To work around this issue, please use SSMS 2012 to copy database from SQL Server 2008 R2 to SQL Server 2012.
    There is a feedback to Microsoft about the issue for your reference.
    https://connect.microsoft.com/SQLServer/feedback/details/810037/copy-database-fails-when-copying-database-from-sql-server-2008-r2-sp2-to-sql-server-2012-sp1 
    Thanks,
    Lydia Zhang

  • SQL Server Import Export Wizard fails while trying to retrieve the data from FastObjects Database

    When trying to import data from FastObjects database to SQL Server 2008 R2 using import/ export wizard we get the following error message :
    "Column information for the source and the destination data could not be retrieved, or the data types of source columns were not mapped correctly to those available on the destination provider."
    Clicked on View button, the source data is retrieved correctly.
    Clicked on Edit Mapping button, the Import Export Wizard failed with the below error message:
    ===================================
    Column information for the source and destination data could not be retrieved.
    "Test" -> [dbo].[Test]:
    - Cannot find column -1.
    (SQL Server Import and Export Wizard)
    ===================================
    Cannot find column -1. (System.Data) 
    at System.Data.DataColumnCollection.get_Item(Int32 index) at System.Data.DataRow.get_Item(Int32 columnIndex) at Microsoft.DataTransformationServices.Controls.ProviderInfos.MetadataLoader.LoadColumnsFromTable(IDbConnection myConnection, String[] strRestrictions)
    at Microsoft.SqlServer.Dts.DtsWizard.OLEDBHelpers.LoadColumnsFromTable(MetadataLoader metadataLoader, IDbConnection myConnection, String[] strRestrictions, DataSourceInfo dsi)at Microsoft.SqlServer.Dts.DtsWizard.TransformInfo.PopulateDbSourceColumnInfoFromDB(IDbConnection
    mySourceConnection) at Microsoft.SqlServer.Dts.DtsWizard.TransformInfo.PopulateDbSourceColumnInfo(IDbConnection mySourceConnection, ColumnInfoCollection& sourceColInfos)

    Hi Chennie,
    Thank you for the post.
    Does the issue persists after you use the "Write a query to specify the data to transfer" option instead of “Copy data from one or more tables or views” option? If so, the issue may occur due to incorrect data type matching between the FastObjects database
    data types and SSIS data types. In this condition, I don’t think it is necessary to upgrade the SQL Server version. Since you can open the Column Mappings dialog box, please try to modify the data type mapping manually.
    In addition, the issue seems to be the same as the issue described in the following blog:
    http://blogs.msdn.com/b/dataaccesstechnologies/archive/2010/09/09/sql-server-import-export-wizard-fails-while-trying-to-retrieve-the-data-from-pervasive-database.aspx 
    Regards,
    Mike Yin
    TechNet Community Support

  • Error in last step of copy database wizard

    Hi All,
    I am getting below mentioned error in copy database wizard. I am using SSMS 2012 to copy a database from one server to another server using attach and detach method. Been stuck in this issue for quite sometime. Please provide your insights...
    Event Name: OnError
     Message: An error occurred while transferring data. See the inner exception for details.
    StackTrace:    at Microsoft.SqlServer.Management.Smo.Transfer.TransferData()
       at Microsoft.SqlServer.Dts.Tasks.TransferObjectsTask.TransferObjectsTask.TransferExtraObjectsViaSmoTransfer()
    InnerException-->There is already an object named 'spt_values' in the database.
    StackTrace:    at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
       at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
       at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.SqlServer.Management.Smo.Transfer.ExecuteStatements(SqlConnection destinationConnection, IEnumerable`1 statements, SqlTransaction transaction)
       at Microsoft.SqlServer.Management.Smo.Transfer.TransferData()
     Operator: EMEA\INCHEJAI
     Source Name: CDW_BIE-WV200_xxxx_xxxx_35
     Source ID: {xxx-xxx-xxx-xxx-xxx}
     Execution ID: {xxx-xxx-xxx-xxx-xxx}
     Start Time: 24.09.2014 10:38:37
     End Time: 24.09.2014 10:38:37
     Data Code: 0
    P.S - I am able to query and fetch the results for "select * from master.dbo.spt_values;"
    in both my SOURCE and DESTINATION databases. 
    But the table name is not visible under System databases--> master --> Tables --> System Tables in my DESTINATION database alone.
    Thanks,
    DeeJay007

    Hi,
    Thanks for your response :). When I tried to attach the the database (.mdf and .ldf) and create a new database in DESTINATION server, it works fine. Only using "Copy database wizard" I face this problem. I am attempting this functionality from
    the SQL Server 2012 instance
    The Instances are not in same version. Find the specific details below for @@Version.
    SOURCE Server Instance
    Microsoft SQL Server 2008 (SP3) - 10.0.5500.0 (X64) 
    Sep 21 2011 22:45:45 
    Copyright (c) 1988-2008 Microsoft Corporation
    Standard Edition (64-bit) on Windows NT 6.0 <X64> (Build 6002: Service Pack 2) (VM)
    DESTINATION Server Instance
    Microsoft SQL Server 2012 (SP1) - 11.0.3000.0 (X64) 
    Oct 19 2012 13:38:57 
    Copyright (c) Microsoft Corporation
    Standard Edition (64-bit) on Windows NT 6.2 <X64> (Build 9200: ) (Hypervisor)
    When you use the copy database functionality, your database gets upgraded to match the destination server version. The database cannot be downgraded, which is fine in your case. It could be a bug in the upgrade process between these two specific sql server
    versions though.
    Can you make a test with another destination instance, with the same version as the original destination (2012 SP1) just to rule out the possibility of system database corruption?
    Does this happen with only a single database, or does the wizzard fail for any database you try to copy?
    I have the "u_tables.sql" file which has the scripts for some master database tables. In the process of trying to rebuild the system database and if I lose the master DB contents, will executing the "u_tables.sql" be sufficient to restore
    the details?? Many DB's are available in the server, so the risk is very high.
    No. However, your application databases won't be affected. You'll lose all your server objects, including but not limited to logins, linked servers, backup triggers, server roles, etc. You'll also lose the contents of the msdb database (jobs, database mail
    configurations, backup history, maintenance plans, etc). Please refer to the article I sent you for more information. It contains safety instructions on how to backup most of these objects.
    Try to do the tests I suggested above before rebuilding your system databases.
    Is there any restrictions for "Copy database wizard" which I am missing here?
    No I dont think so. Based on the information you provided, it should be working.

  • 2008 r2 Copy Database Wizard Error code 0x80004005 (login timeout expired).

    While on copy database wizard, step Configure the package I
    get this error:
    while trying to find a folder on sql an ole db error was encountered with error code 0x80004005 (login timeout expired).
    If I try to run it any way, I got the following in the Execute stage:
    the job failed. check the event log on the destination server for details
    In the destination server, job history:
    Message
    Executed as user: WORKGROUP\servername$. Microsoft (R) SQL Server Execute Package Utility  Version 10.50.1600.1
    for 64-bit  Copyright (C) Microsoft Corporation 2010. All rights reserved.    Started:  3:26:57 PM  Could not load package "package name omitted" because of error 0xC0014062.  Description: The LoadFromSQLServer method
    has encountered OLE DB error code 0x80004005 (Login timeout expired).  The SQL statement that was issued has failed.  Source:   Started:  3:26:57 PM  Finished: 3:27:44 PM  Elapsed:  47.83 seconds.  The package could
    not be loaded.  The step failed.
    I check the job permission with the integration service connection. try with default and with db_ssisadmin. 
    other info:
    Source: Other SQL Server Version, Microsoft SQL Server Enterprise Edition , Build 1617, Microsoft Windows NT 6.0 (6002) NT INTEL X86
    Destination:  Other SQL Server Version, Microsoft SQL Server Data Center Edition (64-bit) , Build 1600, Microsoft Windows NT 6.1 (7601) NT
    x64 Using SMO online transfer

    Hi kexinger,
    This issue might be caused by the insufficient permission for the SQL Agent account, please check the SQL Agent service account has sufficient permissions to the various folders. For detail information, please take a look at the following article:
    http://mattsql.wordpress.com/2014/01/06/quick-tip-could-not-load-package-xxx-because-of-error-0xc0014062/
    If you have any feedback on our support, please click
    here.
    Elvis Long
    TechNet Community Support

  • 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.

  • How can you change data on a SQL 2012 application database that uses availability groups from BizTalk server?

    If you use the WCF-SQL adapter it is recommend that you set UseAmbientTransaction to true if you are changing data. I think this requires MSDTC to be enabled on the SQL server that you are changing the data on. (http://msdn.microsoft.com/en-us/library/dd787981.aspx)
    I think that Availability groups does not support MSDTC. (http://msdn.microsoft.com/en-us/library/ms366279.aspx).
    How can you change data on a SQL 2012 application database that uses availability groups from BizTalk server?

    Hi,
    Yes, Availability groups doesn't support MSDTC. Please refer to the similar discusison which maybe helpfull:
    http://dba.stackexchange.com/questions/47108/alwayson-ag-dtc-with-failover
    http://stackoverflow.com/questions/17179221/msdtc-in-always-on-availability-groups

  • 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

  • Visio Database Wizard fails - ODBC connection to MS SQL

    When I try to create an ODBC connection in Visio's 2010's Database wizard I get the error: "Cannot set the database context information. Additional error information:ODBC Error: s1009. Database cxweba does not exist."
    Note that the database name is cxwebapp_bkk. I get the same error if I connect to any database on that server, and it always truncates the name in the error message (if that is a hint to the error). 
    Using Visio 2013, after connecting to the database: when I select the database object I get the error message:  "The selected table has only one field or contains no definition information. The Database Wizard requires a minimum of one key field
    and one additional data field."
    I have this problem using both SQL Server driver (6.02.9200.116384 and SQL Server Native Client 11.0 (2011.1102.2100.60).
    I do not have this problem connecting to a MYSQL database with either version of Visio, nor do I have this problem when I link link to the same SQL database in a drawing and link shapes in that drawing using the "Link Data to Shapes" under the
    Data tab.

    Hello,
    What's the version of the SQL Server instance you connect to? It seems that the Database Wizard in Visio 2010 not work well with the Microsoft SQL Server ODBC driver. Did you try to use the Generic OLEDB Provider for SQL Server?
    Since the issue is more related to office Visio, please post the question in the following forum. More experts there will assist you:
    Visio General Questions and Answers for IT Professionals
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • BIDS or SQL data Tools for SQL 2012 SP1 database

    I want to start customising reports from my Win 7 workstations. The SCCM server is SQL 2012 SP1
    Do I need to install SQL Server Data Tools onto the workstation or can you still use BIDS (Visual Studio) from SQL 2008 media
    Also I have saved some custom report .RDL files from previous assignments. Can I convert these to point to this site's database for use in SQL 2012 ?
    Ian Burnell, London (UK)

    Thanks Garth - so if I install 2008 BIDS on my W7 workstation then I will be able to connect to the CM2012/SQL 2012 database?
    Yes you will be able to do that. I do it all the time for SQL 2005 or 2008 to SQL 2012 and SQL 2014. :-)
    Garth Jones | My blogs: Enhansoft and
    Old Blog site | Twitter:
    @GarthMJ

  • SCCM 2012 SP1 | Database Replication Failing on from Child to Parent

    I am having a very urgent issue. The symptom manifested itself as an inability to distribute content (this months software update package) to a secondary site server with DP role. 
    As we dived into it we see that the replication links are dead with "Link has failed". 
    Using the replication link analyzer it fixes it for about 1 hour but then fails again. On a closer look I noticed that replication is working from parent to child but not child to parent. Also check out the time stamps:
    Parent Last Send and Child Recv are both up to date, only Parent Last Recv and Child Last Send are failing. 
    What do I do? 
    None of the logs seem to tell me much other than the statesys.log on both secondaries are pumping the following line over and over again almost to fast for cmtrace to keep up with:
    total chucks loaded (0)
    Oh final thought, we did restore a full offline disk image of the primary server a month ago due to a hardware server failure. The snapshot of the disk luckily was taken only 30 mins before the hardware failure but I suppose there could be something related
    to that although the server seems to have been fine these last few weeks until now.  

    Nothing I can see right now, I started the link up again, ill try to check the log right at the time the link fails this time. Here is a snip of what the child rcmctrl.log looks like:
    DRS sync started. SMS_REPLICATION_CONFIGURATION_MONITOR
    11/07/2013 14:43:29 4312 (0x10D8)
    DRS change application started. SMS_REPLICATION_CONFIGURATION_MONITOR
    11/07/2013 14:44:02 4316 (0x10DC)
    Launching 2 sprocs on queue ConfigMgrDRSQueue and 0 sprocs on queue ConfigMgrDRSSiteQueue.
    SMS_REPLICATION_CONFIGURATION_MONITOR
    11/07/2013 14:44:02 4316 (0x10DC)
    The asynchronous command finished with return message: [spDRSActivation finished at 11/07/2013 14:43:02. End execute query finished at 11/07/2013 14:43:02.].
    SMS_REPLICATION_CONFIGURATION_MONITOR
    11/07/2013 14:44:02 4316 (0x10DC)
    There are 2 Drs Activations sprocs running.
    SMS_REPLICATION_CONFIGURATION_MONITOR 11/07/2013 14:44:02
    4316 (0x10DC)
    InvokeRcmMonitor thread wait one more minute for incoming event...
    SMS_REPLICATION_CONFIGURATION_MONITOR
    11/07/2013 14:44:10 4324 (0x10E4)
    InvokeRcmConfigure thread wait one more minute for incoming event...
    SMS_REPLICATION_CONFIGURATION_MONITOR
    11/07/2013 14:44:11 4320 (0x10E0)
    Wait for inbox notification timed out. SMS_REPLICATION_CONFIGURATION_MONITOR
    11/07/2013 14:44:11 4260 (0x10A4)
    Cleaning the RCM inbox if there are any *.RCM files for further change notifications....
    SMS_REPLICATION_CONFIGURATION_MONITOR
    11/07/2013 14:44:11 4260 (0x10A4)
    Initializing RCM. SMS_REPLICATION_CONFIGURATION_MONITOR
    11/07/2013 14:44:11 4260 (0x10A4)
    Processing Replication Configure SMS_REPLICATION_CONFIGURATION_MONITOR
    11/07/2013 14:44:11 4320 (0x10E0)
    Running configuration EnsureServiceBrokerEnabled.
    SMS_REPLICATION_CONFIGURATION_MONITOR 11/07/2013 14:44:11
    4320 (0x10E0)
    Running configuration EnsureServiceBrokerQueuesAreEnabled.
    SMS_REPLICATION_CONFIGURATION_MONITOR
    11/07/2013 14:44:11 4320 (0x10E0)
    Processing Replication Monitor SMS_REPLICATION_CONFIGURATION_MONITOR
    11/07/2013 14:44:11 4324 (0x10E4)
    Summarizing all replication links for monitoring UI.
    SMS_REPLICATION_CONFIGURATION_MONITOR
    11/07/2013 14:44:11 4324 (0x10E4)
    Processing replication pattern global_proxy.
    SMS_REPLICATION_CONFIGURATION_MONITOR 11/07/2013 14:44:11
    4320 (0x10E0)
    The current site status: ReplicationActive.
    SMS_REPLICATION_CONFIGURATION_MONITOR 11/07/2013 14:44:11
    4324 (0x10E4)
    Processing Replication success. SMS_REPLICATION_CONFIGURATION_MONITOR
    11/07/2013 14:44:11 4324 (0x10E4)
    Processing replication pattern procedureForwarder.
    SMS_REPLICATION_CONFIGURATION_MONITOR 11/07/2013 14:44:11
    4320 (0x10E0)
    Running configuration ConfigureLinkedServers.
    SMS_REPLICATION_CONFIGURATION_MONITOR 11/07/2013 14:44:11
    4320 (0x10E0)
    Found 1 servers that needs to be linked. SMS_REPLICATION_CONFIGURATION_MONITOR
    11/07/2013 14:44:11 4320 (0x10E0)
    Processing Replication success. SMS_REPLICATION_CONFIGURATION_MONITOR
    11/07/2013 14:44:12 4320 (0x10E0)
    Rcm control is waiting for file change notification or timeout after 60 seconds.
    SMS_REPLICATION_CONFIGURATION_MONITOR
    11/07/2013 14:44:12 4260 (0x10A4)
    Cleaning the RCM inbox if there are any *.RCM files for further change notifications....
    SMS_REPLICATION_CONFIGURATION_MONITOR
    11/07/2013 14:44:12 4260 (0x10A4)
    Rcm control is waiting for file change notification or timeout after 60 seconds.
    SMS_REPLICATION_CONFIGURATION_MONITOR
    11/07/2013 14:44:12 4260 (0x10A4)

  • " The job failed" in copying database SQL SERVER 2012

    I'm trying to copy a database. When going through the Copy Database Wizard, I'm getting a Execute SQL Server Agent Job error. The error states " The job failed. Check the event log on the destination server for details". See below:
    Performing operation
    Add log for package (Success)
    Add task for transferring database objects (Success)
    Create package (Success)
    Start SQL Server Agent Job (Success)
    Execute SQL Server Agent Job (Error) Messages
    The job failed. Check the event log on the destination server for details. (Copy Database Wizard)
    I can't seem to find what causing this problem. Am I using the correct approach? I just need to copy this database. Thank in advance.

    Hi mohammad2050,
    When using Copy Database Wizard, please make sure that the SQL Server Agent account or Integration Services Proxy account is a member of sysadmin fixed server role, and has access permission on both of source and target file system.
    There is a blog about using SQL Server Copy Database Wizard for your reference .
    http://reddy25.blogspot.com/2013/12/copy-database-from-one-server-to.html
    Thanks,
    Lydia Zhang
    Lydia Zhang
    TechNet Community Support

  • 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>

  • SQLCLR "Create Assembly" validation in SQL 2012 vs 2008

    Greetings, all.
    Could someone describe how the assembly validation steps in SQL 2012 have changed relative to SQL 2008R2?
    My understanding thus far is that the .NET 4.0 SQLCLR runtime requirement now precludes the use of mixed-mode assemblies. If a CREATE ASSEMBLY validation failure result includes messages such as the detection of unmanaged pointers, is that indicative of
    the cut-and-dried, no-way-around-it discovery of a mixed-mode assembly that can
    never be registered in SQL 2012?
    I have a third-party assembly which registers and operates normally in SQL 2008R2, but when I try to create the assembly in our SQL 2012 test environment, it fails validation, with mostly "Unexpected type on stack" or "Unmanaged pointer found"
    errors. I'm suspecting these errors are why the assembly won't register even though CORFLAGS indicates it is a "Pure IL" assembly (and I realize CORFLAGS can be faked).
    Are there any options available? The assembly in question is Oracle.DataAccess.dll, and is part of an assembly that (as one might imagine) collects certain data from Oracle in a SQLCLR method as part of one of our business reporting requirements.
    It appears at the moment I may be forced to modify the tool to use the now-deprecated Microsoft Oracle data client, which I am loathe to do for it having been deprecated and much slower than the Oracle-provided version.
    If there is no workaround, I would respectfully suggest that the "upgrade advisor" team include this kind of review when inspecting existing databases containing .NET assemblies. If we ultimately cannot register this particular third-party assembly
    (which has been part of a working component for several years), it will be a *huge* detriment to our database migration - a far cry from the minor warning about certain geography types provided by the upgrade advisor. It would represent a significant breaking
    change for our environment.
    Thanks for any information that could be provided.

    Thanks for your reply. 
    Yes, you are correct in that SQL Server wants to use only "Pure IL" assemblies rather than mixed-mode assemblies. However, when an attempt is made to register an assembly in the SQLCLR that is "mixed mode" (not pure IL), the Verifier respoinds with "Unverifiable
    PE/Native code stub." This is not the error I am receiving with the assembly in question. 
    SQL2012 and SQL2008R2 do not support the same version of the .NET runtime in the SQLCLR subsystem. The former supports 4.0, while the latter supports 2.0 through 3.5. So it is not possible to create a test case with precisely the conditions you specify -
    that is, using the same version of .NET in SQL2012 and SQL2008R2 - unless there is some undocumented startup switch or configuration file modification that can be made of which I am not aware.
    The failure mode I am seeing is specifically tied to the reference of unmanaged
    code references, eg unmanaged pointers. The 2.x assembly registered an working in SQL2008R2 (and its predecessors) contains multiple references to functions with unmanaged pointers, yet registers and works properly when the assembly is CREATED with PERMISSION_SET
    = UNSAFE. I expect the same behavior in SQL 2012 - an assembly with references to things like unmanaged pointers should still verify when PERMISSION_SET = UNSAFE is specified.
    This is why I am questioning whether the semantics of PERMISSION_SET = UNSAFE in conjunction with the CREATE ASSEMBLY statement have changed between SQL2008 and SQL2012. To me, it appears that SQL2008R2 and its predecessors verified assemblies via the internal
    equivalent of a PEVERIFY /MD when PERMISSION_SET = UNSAFE is used, and PEVERIFY /IL when it is not. In SQL2012, it appears that the equivalent of PEVERIFY /IL is done
    regardless of the presence of PERMISSION_SET = UNSAFE. This, to my understanding, is contrary to the whole point of PERMISSION_SET = UNSAFE. 
    PEVERIFY /IL on the previous version of the assembly generates precisely the same kinds of errors generated by the CLR Verifier in SQL2008
    without PERMISSION_SET = UNSAFE. When the latter is specified, the assembly registers and works normally. I contend that the CLR Verifier in SQL2012 is ignoring the PERMISSION_SET = UNSAFE qualifier, and hence my search for more information
    about how the semantics of this command may have changed specifically for SQL2012.
    IF there is an unsupported/undocumented method of allowing the SQLCLR to support both .NET 4.0 and .NET 2.0, I would be very interested in exploring how to leverage it. 
    Thank you for your interest.

  • Unable to copy database with different name in the same instance

    I had a huge database and wanted to try some change optimization changes.
    So wanted to make a copy of the database along with data in the same instance.
    I have tried copy database wizard several times but always see the error as in attachment.
    Can someone let me know how to troubleshoot further?
    If this is not the correct way please suggest how do i copy a database with different name in the same instance along with data.

    Hi Nandu,
    From the screenshot, the error 1813 happens when corrupt database log is attempted to attach to the SQL Server. To work around this issue, please preform the following steps, for more details, please review this
    blog.
    1. Create a new database with same name which you want to recover. Make sure that the MDF file and LDF file have same name with previous database data and log file.
    2. Stop SQL Server. Move original MDF file from old location to new location by replacing just created MDF file. Delete the LDF file of new location just created.
    3. Start SQL Server. At this point, the database is in suspect status.
    4. Make sure that system tables of Master database allows to update the values. Please note that you will be performing this in query window.
    Use Master
    go
    sp_configure 'allow updates',1
    reconfigure with override
    go
    5. Change database mode to emergency mode.
    SELECT *
    FROM sysdatabases
    WHERE name = 'DatabaseName'
    BEGIN
    UPDATE sysdatabases
    SET status = 32768
    WHERE name = ' DatabaseName '
    COMMIT TRAN
    6. Restart SQL Server. Then execute the following DBCC command in query window to create new log file.
    DBCC TRACEON (3604)
    DBCC REBUILD_LOG(databasename,'c:\yourdatabasename_log.ldf')
    GO
    7. Reset the database status using following command.
    sp_RESETSTATUS yourdatabasename
    GO
    8. Turn off the update to system tables of Master database running following script.
    USE MASTER
    GO
    sp_CONFIGURE 'allow updates',0
    RECONFIGURE WITH OVERRIDE
    GO
    9. Reset the database status to previous status.
    BEGIN
    UPDATE sysdatabases
    SET status = (value retrieved in first query of step 5)
    WHERE name = 'DatabaseName‘
    COMMIT TRAN
    GO
    Make sure that you have done all the steps in order and restarted SQL Server where it is mentioned. Also run SQL Server Management Studio as administrator.(Right click-> Run as Administrator)
    Thanks,
    Lydia Zhang

Maybe you are looking for