come convertire i file di database MDF / LDF di .bak (dB ripristino) utilizzando T-SQL o un codice .net

StackOverflow https://stackoverflow.com/questions/4615521

Domanda

Ho file di database di SQL Server (MDF / LDF) e voglio convertirli in file di backup utilizzando i comandi T-SQL o .net codice (C # o VB.NET).

tutti i suggerimenti.

thans

È stato utile?

Soluzione

BACKUP DATABASE [NameOfDatabase] TO  DISK = N'D:\path\filename.bak' 
WITH NOFORMAT, NOINIT,  NAME = N'NameOfDatabase-Full Database Backup', 
SKIP, NOREWIND, NOUNLOAD,  STATS = 10  

Replace NameOfDatabase with name of your database.
Replace D:\path\filename.bak with place you want to backup with
Replace Name = N database name for cosmetic indexing reasons...

Fonte originale - http://forums.asp.net/p/1448416/3870094 aspx

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top