SQL Server: unable to copy database I'm trying to create a dev database so I don't create triggers and such on the production database. I use the right click -> Taks -> Copy, followed the wizard and the process starts. 

After maybe a minute, it stops and says Error.

The Event Viewer says this: 

Package "ShellPackage" failed.

Event Name: OnError
 Message: ERROR : errorCode=-1073548784 description=Executing the query "CREATE VIEW [dbo].[VIEWNAME]
AS
SEL..." failed with the following error: "Invalid column name 'C_27'.". 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:   Microsoft.SqlServer.Management.Dts.DtsTransferProvider.ExecuteTransfer()
Microsoft.SqlServer.Management.Smo.Transfer.TransferData()
Microsoft.SqlServer.Dts.Tasks.TransferObjectsTask.TransferObjectsTask.TransferDatabasesUsingSMOTransfer()
Operator: DOMAIN\administrator
 Source Name: SERVER_SERVER_Transfer Objects Task
 Source ID: {47D1A40A-A6CF-4A5C-897E-80CB9C1D6151}
 Execution ID: {3E979DF7-C5DC-4583-8613-CB9AC9153D56}


What am I doing wrong?

Thank you!
Best and most reliable way is to use backup / restore

If your database is big and you are on sql server 2008 R2 and up, standard edition also has compression feature to allow you to compress your backups.

Dont forget to sync up users after the restore :-)