I have virtual hosting with SQL Server. I don't have physical access to SQL Server. I want to make backup and download it. How can I do it from asp.net page?
You could issue the BACKUP commands from ASP.NET the same way as you would any other SQL query or command.
http://msdn.microsoft.com/en-us/library/ms186865.aspx
- Construct a unique name for the backup file
- Connect to SQL and issue the relevant BACKUP commands
- Check the backup was successful, the backup file exists and stream it back to your browser (using Response.TransmitFile)
Hi Kusanagi,
Even if you do not have physical access to mssql your hosting provider may have a way through your control panel GUI to make a mssql backup and download it. You might want to check with them first.
Jon
I think some people here are taking mental shortcuts and suggesting you backup the SQL as if you had full access to the machine (which you specifically state you do not have).
You will not be able to do a standard backup to C:\Backup or C:\[anything] on a hosted environment.
You need to see if you can remotely access your SQL Server instance through SQL Server Management Studio (I have used hosts that do allow remote access to the SQL Server port), and then, instead of doing a normal backup to a BAK file (which implies having access to a local hard drive in the SQL Server), right click on the database and try to create a script from there. You will get a script similar to the scripts that mysqldump creates for MySQL.
If that fails, then look into your control panel, they may have a tool that does that as well, or one that sends you a BAK file generated through the control panel.
Failing that, ask your host.