This set of SQL Server Multiple Choice Questions & Answers (MCQs) focuses on “Transferring Database”.
1. Which of the following wizard provides creation logins on the destination server?
a) Copy Database
b) Move Database
c) Detach database
d) Attach database
View Answer
Explanation: The Copy Database Wizard lets you move or copy databases and their objects easily from one server to another.
2. Point out the correct statement.
a) After a database has been upgraded, it cannot be downgraded to a previous version
b) The Copy Database Wizard is available in the Express edition
c) The Copy Database Wizard cannot be used to copy System databases
d) None of the mentioned
View Answer
Explanation: System databases cannot be transferred using Copy database wizard.
3. How many ways are provided by SQL Server to copy a database?
a) 2
b) 3
c) 4
d) 5
View Answer
Explanation: SQL Server provides mainly three ways to copy a database.
4. Which is not the preferred way of copying a database?
a) Using the Copy Database Wizard
b) Restoring a database backup
c) Using the Generate Scripts Wizard to publish databases
d) None of the mentioned
View Answer
Explanation: Generate script wizard produces unnecessary computation internally to copy a database.
5. Point out the wrong statement related to the use of Copy database wizard.
a) Pick a source and destination server
b) System stored procedures
c) Schedule when to move or copy the databases
d) None of the mentioned
View Answer
Explanation: Copy database wizard copies additional supporting objects, jobs, user-defined stored procedures, and error messages.
6. Which of the following returns a list of the database and log files?
a) RESTORE FILELISTON
b) RESTORE FILELIST
c) RESTORE FILELISTONLY
d) All of the mentioned
View Answer
Explanation: A client can use RESTORE FILELISTONLY to obtain a list of the files contained in a backup set. This information is returned as a result set containing one row for each file.
7. Which of the following transfer method makes the database unavailable to users during the transfer?
a) Detach and attach method
b) SQL Management Object method
c) Restore method
d) None of the mentioned
View Answer
Explanation: Detach the database from the source server, copy the database files to the destination server, and attach the database at the destination server.
8. Which of the following stored procedure is used for detachment of database?
a) sp_replicationdboption
b) sp_replicationdb
c) sp_replicationoption
d) all of the mentioned
View Answer
Explanation: If you cannot use sp_replicationdboption, you can remove replication by running sp_removedbreplication.
9. Which of the following code snippet will detach AdventureWorks2012 database?
a)
USE master; GO EXEC xp_detach_db @dbname = N'AdventureWorks2012'; GO
b)
USE master; GO EXEC sp_detach @dbname = N'AdventureWorks2012'; GO
c)
USE master; GO EXEC sp_detach_db @dbname = N'AdventureWorks2012'; GO
d)
USE master; GO EXEC sp_det_db @dbname = N'AdventureWorks2012'; GO
Explanation: sp_detach_db detaches a database that is currently not in use from a server instance.
10. Which of the code is valid for attaching the database?
a)
USE master; GO CREATE DATABASE MyAdventureWorks ON (FILENAME = 'C:\MySQLServer\AdventureWorks2012_Data.mdf'), (FILENAME = 'C:\MySQLServer\AdventureWorks2012_Log.ldf') FOR ATTACH; GO
b)
USE master; GO CREATE DATABASE MyAdventureWorks ON (FILENAME = 'C:\MySQLServer\AdventureWorks2012_Data.mdf'), (FILENAME = 'C:\MySQLServer\AdventureWorks2012_Log.ldf') TO ATTACH; GO
c)
USE master; GO CREATE DATABASE MyAdventureWorks ON (FILENAME = 'C:\MySQLServer\AdventureWorks2012_Data.mdf'), (FILENAME = 'C:\MySQLServer\AdventureWorks2012_Log.ldf') FOR ATTACH_DB; GO
d) None of the mentioned
View Answer
Explanation: Attach the moved database and, optionally, its log by executing the following Transact-SQL statements.
Sanfoundry Global Education & Learning Series – SQL Server.
To practice all areas of SQL Server, here is complete set of 1000+ Multiple Choice Questions and Answers.
- Check Information Technology Books
- Apply for Programming Internship
- Practice Programming MCQs
- Check SQL Server Books