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?
BACKUP DATABASE @strDB TO DISK =@BackupFile WITH RETAINDAYS = 10, NAME = N'MyDataBase_DATA-Full Database Backup', STATS = 10You must define @BackupFile and @strDB as the database name.
All of this is free in Books Online which you can find online.