Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Database backup using T-SQL

Author  Topic 

imughal
Posting Yak Master

192 Posts

Posted - 2004-06-09 : 00:27:22
hi,
i want to take my database backup. I have remote access to my SQL server. When i try to access database through enterprise manager it gets hanged/ no response. But i can easily connect and access database through query analyzer.

IS there any way to take database backup by using query analyzer or T-SQL.

regards,
irfan

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2004-06-09 : 00:33:31
Yes

Look up "BACKUP DATABASE" in Books Online for Syntax.


Damian
Go to Top of Page

pjn
Starting Member

27 Posts

Posted - 2004-06-09 : 06:42:49
As Merkin says, check BOL for exact syntax, but as a quick guide, I use the following code for adhoc backups:


BACKUP DATABASE MyDatabase
TO DISK = 'C:\MyBackup.bak'
WITH INIT,
NAME = 'MyDatabaseBackup',
NOFORMAT,
NOSKIP

Go to Top of Page
   

- Advertisement -