SQL Server 2008, restore .back without management studio

1

I explain a little, I have an application that I install in the client machines along with the sql express (without management stdudio), the dilemma is that I have to restore a backup, but I do not know how to do it without the management studio, someone knows how I can do it? maybe some exe that exists around free or something, everything works.

    
asked by RSillerico 03.06.2016 в 23:56
source

3 answers

1

We go in parts,

To make a backup:

In the windows, enter as Administrator, execute the CMD as administrator and give the following command:

SqlCmd -E -S Server_Name –Q “BACKUP DATABASE [Name_of_Database] TO DISK=’X:PathToBackupLocation[Name_of_Database].bak'”

These examples could be useful for you:

Default SQL Server instance:

SqlCmd -E -S MyServer –Q “BACKUP DATABASE [MyDB] TO DISK=’D:BackupsMyDB.bak'”

Named SQL Server instance:

SqlCmd -E -S MyServerMyInstance –Q “BACKUP DATABASE [MyDB] TO DISK=’D:BackupsMyDB.bak'”

Restore a database from the command line:

To restore a database from a backup file, use the command:

SqlCmd -E -S Server_Name –Q “RESTORE DATABASE [Name_of_Database] FROM DISK=’X:PathToBackupFile[File_Name].bak'”

For example:

SqlCmd -E -S MyServer –Q “RESTORE DATABASE [MyDB] FROM DISK=’D:BackupsMyDB.bak'”

Reference: link

    
answered by 04.06.2016 в 00:08
1

vote against accept In this link I found the answer:

link

As you can see, it does it differently by opening the instance and then entering the codes.

Greetings.

    
answered by 06.06.2016 в 16:16
0

The best recommendation I can give you to do this is the execution of the restoration or backup of the database from the cmd below I leave a link which will redirect you to a page with syntax and examples of the requested : link

    
answered by 20.06.2016 в 07:28