1.

In an SQL Server 2008 instance, which of the following will you check to clarify whether the database integrity check (DBCC CHECKDB) is implemented for a special database?

2.

In an SQL Server, which of the following statements is used to create the database called toys with at least 50 MB of free space and 15 MB as start size for the transaction log?

3.

In an SQL Server, which of the following codes will successfully add the .ndf file to a filegroup?

4.
You are mastering a database, with an SQL Server computer named SQLTEST1. The master database on SQLTEST1 is down. An SQL Server agent job should be included in the SQLTEST1. The whole database should be backed up every day. 
Which of the following will you perform to rebuild and restore the master database and make sure that SQLTEST1 functioned as it did before the database was lost?
5.

If you have a table with fragmented indexes in an SQL server instance, how will you ensure that the effect on the database availability is minimized?

6.

When a web application is moved from Microsoft SQL Server 2005 to Microsoft SQL Server 2008, certain features stop. Which of the following does an SQL server sample use to retain such features?

7.
In SQL Server, what is the correct sequence of steps for creating a partitioned table using horizontal partitioning?
  1. Create additional filegroups
  2. Check the status of available filegroups after creation
  3. Add .ndf file to every filegroup
  4. Check status of files which are created and added to the filegroups
  5. Create a partition function
  6. Create a partition scheme using the partition function
  7. Create the partition table using the partition scheme
8.
You are checking the security of an SQL Server instance of a database. The requirements are listed as follows:
  1. Successful login attempts in the log files
  2. Failed login attempts in the log files
  3. The SQL Server instance is closed if the records cannot be written to the log files
Which of the following commands is used to set the SQL Server sample to meet the requirements?
9.

You have created the following dbo.Emp_records procedures and you want to check if any procedure of that name exists. If it exists already, then delete the procedure and create a new one. However, the following procedure generates an error. Identify the correct code which performs the task.


 
 
IF EXISTS(SELECT * FROM sys.sys_files WHERE SCHEMA_ID = SCHEMA_ID('dbo') AND name = N 'Emp_records')
DROP PROCEDURE dbo.Emp_records
GO

Create Procedure dbo.Emp_records(

    @EmpFirstName Varchar(200), @EmpLastName Varchar(200), @EmpEmail Varchar(50)
)

As

Begin

Insert into tbl_Employees(Firstname, lastname, Email)
Values("@EmpFirstName", "@EmpLastName", "@EmpEmail")

End
10.

The following code was used to create a stored procedure for adding the details of a new category to the table named category:


 
 
CREATE PROCEDURE prcAddCategory@ CategoryId
char(3), @Category char(20), @Descrip char(30)

as

INSERT Category
VALUES(‘CategoryId’, ’Category’, ’Descrip’)

After successful creation of the following procedure the following code was used to execute the procedure
for inserting a new category:

    Exec prcAddCategory‘ 017’, ‘War Games’, ‘A wider range of toy guns’

 
 

The given code generated an error and was aborted. You need to detect the error and rectify the code.