Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2004

    Exclamation Unanswered: Issues with copying database.

    I am using Microsoft SQL Server Managment Sudio 2008 to copy a database to a development copy. This is so I can make changes with out messing up production.

    The problem is that it is trying to create the views before it creates the tables and the error that came up durring the transaction was...

    Event Name: OnError
    Message: ERROR : errorCode=-1073548784 description=Executing the query

    "CREATE VIEW [dbo].[InstallersPotentiallyActive]
    SELECT [License Number], Class, Status, [Company Name], [First Name] + ' ' + [Last Name] AS [QP Name], Phone, InstallerCredits
    FROM dbo.License
    WHERE (Type = 'I') AND (Status = 'V') OR
    (Type = 'I') AND ([Action Type] = 'N') AND ([Action Date] > '2008-12-14')


    failed with the following error: "Invalid object name 'dbo.License'.". 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={8BDFE893-E9D8-4D23-9739-DA807BCDC2AC}
    StackTrace: at Microsoft.SqlServer.Management.Dts.DtsTransferProv ider.ExecuteTransfer()
    at Microsoft.SqlServer.Management.Smo.Transfer.Transf erData()
    at Microsoft.SqlServer.Dts.Tasks.TransferObjectsTask. TransferObjectsTask.TransferDatabasesUsingSMOTrans fer()
    Source Name: SVR020_SVR020_Transfer Objects Task
    Source ID: {25F5CB55-6E78-426C-8773-F8E40D4181BF}
    Execution ID: {8E1349ED-7195-4E19-BE71-E50034E4F729}
    Start Time: 4/2/2014 8:45:24 AM
    End Time: 4/2/2014 8:45:24 AM
    Data Code: 0

    Of cource it has this error because it had not created the tables first. Is there something I am missing in the "Right-click -> Tasks -> Copy Database" wizard that is not allowing the tables to be created before the views? I guess I could just do a backup and restore instead.

    Thanks for any input.

  2. #2
    Join Date
    Jan 2003
    Provided Answers: 17
    The copy database wizard tends to copy things in alphabetical order. It was a choice they made. A better way may be to just take a full backup of the production database, and copy that to your dev box. It will get everything as it is. Alternatively, you can go with a phased approach, and import all the tables to the dev box, then all the views, then all the procedures and functions (functions may need to go earlier, though, depending on dependencies).

  3. #3
    Join Date
    Feb 2013
    perth australia
    I never found the copy database wizard reliable. just use database backup/restore

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts