Just a couple quick questions
I need to:
Copy an existing production database to a new database on the same server; this will be used for development.
Copy an existing table for backup purposes in preparation for deleting a couple fields from the table (precautionary process really).
I've been out of the database swing if you will for a while, just now getting the opportunity to get my feet wet so to speak. I can use either Enterprise Manager or connec to the database via ODBC and make the copies/deletes there, but I'm looking to do this via EM or SQL command.
Any help or direction would be greatly appreciated!
Thanks!
Bobby
You can use Copy Database Wizard. Right click on your production database, select Tasks->Copy Databse.... Choose source and destionation databases...
Or you can backup your production database then restore it on the development database.
EM:
To backup, right click on your prod_db, select Tasks->Backup.... Add file or backup device then back up to there.
To restore, right click on your dev_db, select Tasks->Restore->Database. Choose that your backup file or device where the prod_db backed up.
T-SQL command:
BACKUP DATABASE [Production] TO [Product_Backup] WITH INIT , NAME = N'Production backup', NOSKIP , STATS = 10, NOFORMAT
For the first problem, I would use a backup and restore, when restoring specify a new database name and file locations to duplicate the current environment. Check out the restore command in the Books Online. To back up the table I would just do the complete database as you might find that the data in the table is used in other areas (But that depends on how your system is set up). If you do wish to dump the file you can use the sqlcmd command line tools and specify an output file, you could also use the Query tools and save the output as text. The other option is to use DTS or the New SSIS system to run an export and save the raw data of the table.