简体   繁体   中英

SQL SSMS Copy Database Wizard Fails

I am trying to copy a database from one server to another using the Copy Database Wizard included in SSMS. It always fails with :

ERROR : errorCode=-1073548784 description=Executing the query " CREATE CLUSTERED INDEX [IX_CO_Summary_PostDate] ..." failed with the following error: "CREATE INDEX failed because the following SET options have incorrect settings: 'ANSI_PADDING'. Verify that SET options are correct for use with indexed views and/or indexes on computed columns and/or filtered indexes and/or query notifications and/or XML data type methods and/or spatial index operations.". Possible failure reasons: Problems with the query "ResultSet" property not set correctly parameters not set correctly or connection not established correctly.`

Can anybody dissect this and help me figure out where I went wrong? Both SQL servers are SQL Server 2008 R2, I connect with SQL Server authentication, and use the SQL Server Management Object method since I require the original database to stay live in production.

The complete error log is here:

Date,Source,Severity,Step ID,Server,Job Name,Step Name,Notifications,Message,Duration,Sql Severity,Sql Message ID,Operator Emailed,Operator Net sent,Operator Paged,Retries Attempted 11/12/2013 08:46:36,CDW_FEZ_FUNDEZ_E-MDS_0,Error,0,E-MDS,CDW_FEZ_FUNDEZ_E-MDS_0,(Job outcome),,The job failed. The Job was invoked by User sa. The last step to run was step 1 (CDW_FEZ_FUNDEZ_E-MDS_0_Step).,00:02:08,0,0,,,,0 11/12/2013 08:46:36,CDW_FEZ_FUNDEZ_E-MDS_0,Error,1,E-MDS,CDW_FEZ_FUNDEZ_E-MDS_0,CDW_FEZ_FUNDEZ_E-MDS_0_Step,,Executed as user: E-MDS\\SYSTEM. Microsoft (R) SQL Server Execute Package Utility Version 10.0.5500.0 for 64-bit Copyright (C) Microsoft Corp 1984-2005. All rights reserved. Started: 8:46:36 AM Progress: 2013-11-12 08:46:37.18 Source: FEZ_FUNDEZ_E-MDS_Transfer Objects Task Task just started the execution.: 0% complete End Progress Error: 2013-11-12 08:48:42.79 Code: 0x00000000 Source: FEZ_FUNDEZ_E-MDS_Transfer Objects Task Description: ERROR : errorCode=-1073548784 description=Executing the query " CREATE CLUSTERED INDEX [IX_CO_Summary_PostDate] ..." failed with the following error: "CREATE INDEX failed because the following SET options have incorrect settings: 'ANSI_PADDING'. Verify that SET options are correct for use with indexed views and/or indexes on computed columns and/or filtered indexes and/or query notifications and/or XML data type methods and/or spatial index operations.". Possible failure reasons: Problems with the query "ResultSet" property not set correctly parameters not set correctly or connection not established correctly. helpFile= helpContext=0 idofInterfaceWithError={C81DFC5A-3B22-4DA3-BD3B-10BF861A7F9C} StackTrace: at Microsoft.SqlServer.Management.Dts.DtsTransferProvider.ExecuteTransfer() at Microsoft.SqlServer.Management.Smo.Transfer.TransferData() at Microsoft.SqlServer.Dts.Tasks.TransferObjectsTask.TransferObjectsTask.TransferDatabasesUsingSMOTransfer() End Error Progress: 2013-11-12 08:48:42.82 Source: FEZ_FUNDEZ_E-MDS_Transfer Objects Task Database transfer failed for 1 database(s).: 0% complete End Progress Progress: 2013-11-12 08:48:42.82 Source: FEZ_FUNDEZ_E-MDS_Transfer Objects Task Transfer objects finished execution.: 100% complete End Progress Warning: 2013-11-12 08:48:42.82 Code: 0x80019002 Source: CDW_FEZ_FUNDEZ_E-MDS_0 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: 8:46:36 AM Finished: 8:48:42 AM Elapsed: 126.142 seconds. The package execution failed. The step failed.,00:02:08,0,0,,,,0

Goal is to schedule a copy of this "production" system to an analysis server for reporting periodically (once per week) so that the reporting function does not interact with the live system.

The Copy Database wizard kept failing for me. I was also unable to export the schema and data scripts as the database was too large. Additionally I was also unable to do a backup to my local machine since the server was on a hosted environment and did not have access. This doesn't set any auto Identity columns though. My solution was:

  1. Create the a new blank local database.
  2. Use the Import wizard, right click on database. Tasks->Import Data
  3. Use the Sql Server Native Client and set the Source and Destination. This will import the tables / data but will not import the indexes / constraints.
  4. Use the scripts below to get the indexes / constraints and foreign key from your source and run them on your local database. https://www.mssqltips.com/sqlservertip/3443/script-all-primary-keys-unique-constraints-and-foreign-keys-in-a-sql-server-database-using-tsql/
CREATE CLUSTERED INDEX [IX_CO_Summary_PostDate] ...

failed with the following error:

CREATE INDEX failed because the following SET options have incorrect settings: 'ANSI_PADDING'.

You have an indexed view in you database. The wizard tries to recreate the index but your session doesn't have the proper settings. Try to remove this object from the objects copied by the wizard and recreate the view and its index manually afterwards.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM