I would like to know to how to take backup of system databases? and is there any difference between taking backup of user databases and system database? and how to restore? I need T-SQL command?
2 Answers
The commands are the same, that's true, but system DBs do need special consideration both for backup and for restore. The topic is discussed at length in the Considerations for Backing Up and Restoring System Databases chapter in BOL. This has also 4 sub-chapters about backing up and restoring master
on one hand, and model
and msdb
on the other hand. Read the documentation first, then come back if you still have more questions.
Backing up a system database is basically the same than backing up a non-system database, as marc_s already pointed out in his comment.
One difference is that the system databases are always in Simple Recovery Model, so it's not possible to do transaction log backups.