Coding tips, programming hacks and sharing knowledge.
1. Open SQL Server Management Studio and connect to an appropriate instance of Microsoft SQL Server Database Engine. Click the server name in the Object Explorer to expand the server tree.
2. Expand Databases node and select either a user database or a system database.
3. Right click the database, point to Tasks, and then click Back Up option to open up the Back Up Database dialog box.
4. Verify the database name in the Database list box. You can also optionally select a different database from the list. You can perform a database backup for any recovery model (FULL, BULK_LOGGED, or SIMPLE).
5. Select Full in the Backup type list box.Note: After creating a full backup, you can later create a differential database backup.
6. You can perform a copy-only backup of a database by checking the Copy-only Backup checkbox. A copy-only backup is a SQL Server backup that is independent of the sequence of conventional SQL Server backups.
7. In the Backup Component select Database. In the Backup set, you can leave the Name as default or enter a different name and optionally enter a Description. Leave the default value as 0 days for Backup set will expire after option.
8. Choose the type of backup Destination by clicking Disk, Tape or URL. Click the Add button to select the path or device where you want to backup the database.
9. The Select Backup Destination dialog opens up. Browse the path or device where the backup is to be made and click OK to return to the Backup Database dialog box.
10. You can remove a backup destination, by selecting it and clicking Remove. And you can view the contents of a backup destination, by selecting it and clicking Contents.
11. To view or select the media options, click Options in the Select a page pane.
12.In Overwrite Media choose "Back up to the existing media set" and "Append to the existing backup" set options.
13. In the Reliability section, optionally check:Verify backup when finished option. By selecting this option you can make sure the database backup is good.
14. SQL Server 2008 Enterprise and later supports backup compression. By default, whether a backup is compressed depends on the value of the backup-compression default server configuration option. However, regardless of the current server-level default, you can compress a backup by selecting "Compress backup", and you can prevent compression by selecting "Do not compress backup" from the Set backup compression option.
15. Finally click OK to create the backup.
While creating a new solution, you might want to add an existing SQL Server existing database to your solution in Visual Studio. This blog illustrates with pictures how t...
We recently started using database project in our application. To get the updated stored procedures from database project to destination database we were using "Buil...