Nhãn hiệu của chúng tôi

Impact-Company-Logo-English Black-01-177x54

Chào mừng bạn đến với Trang web của Schneider Electric

Chào mừng đến với trang web của chúng tôi.
		
Hôm nay chúng tôi có thể giúp gì cho bạn?
How to restore a database using TSQL commands
Issue
For use when a database needs to be restored via TSQL instead of via the graphical interface in SQL Server Management Studio.

Produce Line
Microsoft SQL Server

Environment
Microsoft SQL Server 2005
Microsoft SQL Server 2008
Microsoft SQL Server 2008 R2
Microsoft SQL Server 2012
Microsoft SQL Server 2012 R2

Cause
A database needs to be restored using the SQL Server Management Studio, but standard restore option is not functioning.

Resolution
*Warning: Irreparable database damage can occur. This procedure should only be performed by
users familiar with SQL Server Management Studio. Databases should be backed up prior to
performing this procedure.*


The following query can be used to restore a database.

---------------------------------
Use Master
Go
RESTORE DATABASE YourDB
FROM DISK = 'C:\YourBackUpFile.bak'
WITH MOVE 'YourMDFLogicalName' TO 'D:\Data\YourMDFFile.mdf',
MOVE 'YourLDFLogicalName' TO 'D:\Data\YourLDFFile.ldf'
---------------------------------

YourDB -> The name of the database inside SQL Server. Examples are "ION_Data" or "SMS_System".

YourBackUpFile -> This will be the full path of the BAK file you are looking to restore.

YourMDFLogicalName -> The logical name of the database container (MDF file) must be known. To determine this information, open SQL Server Management Studio and connect to the instance the original database is attached to (this will be the database that was backed up to create the BAK file). Right-click on the database and select Properties>Files. There is a column named "Logical Name" that will provide the logical name of the database container. (See graphic below.)

YourMDFFile -> This is the path and file name of where you would like the MDF file to be located.

YourLDFLogicalName -> The logical name of the database transaction log (LDF file) must be known. To determine this information, open SQL Server Management Studio and connect to the instance the original database is attached to (this will be the database that was backed up to create the BAK file). Right-click on the database and select Properties>Files. There is a column named "Logical Name" that will provide the logical name of the database transaction log. (See graphic below.)

YourLDFFile -> This is the path and file name of where you would like the LDF file to be located.

How to restore a database using TSQL commands

Schneider Electric Việt Nam

Tìm hiểu thêm
Sản phẩm:
Tìm hiểu thêm
Sản phẩm:

Bạn cần trợ giúp?

  • Công cụ chọn sản phẩm

    Nhanh chóng và dễ dàng tìm được sản phẩm và phụ kiện phù hợp cho các ứng dụng của bạn.

  • Nhận báo giá

    Bắt đầu gửi yêu cầu bán hàng trực tuyến và chuyên gia sẽ liên hệ với bạn.

  • Nơi mua hàng?

    Dễ dàng tìm nhà phân phối Schneider Electric gần bạn nhất.

  • Trung tâm Hỗ trợ

    Tìm sự hỗ trợ cho mọi nhu cầu của bạn tại một nơi.

  • Tài liệu về Sản phẩm
  • Tải xuống phần mềm
  • Công cụ chọn Sản phẩm
  • Thay thế và thay đổi sản phẩm
  • Trung tâm Hỗ trợ
  • Tìm Văn phòng của chúng tôi
  • Nhận báo giá
  • Tìm Nhà Phân phối
  • Cơ hội nghề nghiệp
  • Hồ sơ doanh nghiệp
  • Báo cáo hành vi sai trái
  • Khả năng truy cập
  • Phòng tin tức
  • Nhà đầu tư
  • EcoStruxure
  • Tìm việc
  • Blog
  • Chính sách bảo mật
  • Thông báo về Cookie
  • Điều khoản sử dụng
  • Change your cookie settings