0

I am looking for a way to backup a SQL Server database with T-SQL. I do no have root access to this server through the console, as my only access comes through SQL Server Management Studio.

Could someone please show me the SQL that I could use to export the raw SQL for my entire database?

0

2 Answers 2

4

BACKUP DATABASE @strDB TO DISK =@BackupFile WITH RETAINDAYS = 10, NAME = N'MyDataBase_DATA-Full Database Backup', STATS = 10

You must define @BackupFile and @strDB as the database name.

All of this is free in Books Online which you can find online.

Sign up to request clarification or add additional context in comments.

Comments

2

If you only have access to the server through Management Studio, where do you expect it to stream your backup? Getting the T-SQL to work is one thing - getting SQL Server to be able to write the backup to a place where you can access it is quite another. You may want to look at Red-Gate's SQL Azure Backup:

http://www.red-gate.com/products/dba/sql-azure-backup/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.