Mssql Compressed database check backup set Repair Database SQL statement

Source: Internet
Author: User
Tags mssql server
Mssql compression database check backup set Repair Database SQL statement this tutorial provides SQL statements about mssqlserver compression database check backup set repair database, and the operation method described by the instance.

Mssql compression database check backup set Repair Database SQL statements this tutorial provides SQL statements about mssql server compression database check backup set repair database, and the operation method described by the instance.

Mssql compression check backup set restoration Database SQL statement

This tutorial provides SQL statements about how mssql server compresses the database, checks the backup set, and fixes the database, and describes the operation methods.
3. compress the database

Dbcc shrinkdatabase (dbname)


4. transfer the database to a new user with the existing user permission

Exec sp_change_users_login 'update _ one', 'newname', 'oldname'


Go
5. check the backup set

Restore verifyonly from disk = 'E: dvbbs. bak'


6. restore the database

Alter database [dvbbs] set single_user
Go
Dbcc checkdb ('dvbbs ', repair_allow_data_loss) with tablock
Go
Alter database [dvbbs] set multi_user
Go

The preceding SQL statement is simple, but it has a great effect and is expected to be useful to you.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.