DBA > Interview Resource

Microsoft SQL Server FAQs

Part:   1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36  37  38  39  40  41 

(Continued from previous part...)

What does this code return?
select 4 & 5
Don't run it, figure it out.

Answer: 4

Explanation: This returns a 4, which is the result of a logical AND between these two numbers. They are represented as follows (low bits only):
4 - 0100
5 - 0101
and AND returns the matching bits, which in this case are only those in the 3rd position.


With SQL Server 2005, Oracle servers can be included in your replication topology. How can an Oracle server function?

Answer: As a subscriber or publisher.

Explanation: Oracle can act as a publisher or subscriber, but not a distributor.


In SQL Server 2005, what permissions does a user need to successfully execute the USE command?

Answer: CONNECT permission on the target database.

Explanation: A user needs the CONNECT permission on the target database.


If you want to apply a hot fix to SQL Server 2005, do you need to apply them all in order?

Answer: You need to only apply the latest hot fix.

Explanation: Hot fixes are cumulative, so if you want to apply the latest hot fix, it will include all the previous ones.


What does this return on SQL Server 2005?
select NEWSEQUENTIALID()

Answer: This returns an error.

Explanation: This returns an error. The NEWSEQUENTIALID() function can only be used in a default constraint on a table, not in a query. When used there it returns a new GUID that is greater in value than any previously generated GUIDs.


Which key does the OPEN MASTER KEY statement open?

Answer: This opens the Database Master Key

Explanation: This statement is used to open the Database Master Key for the database in which it is run. A password must be supplied as well.


You have created a view and are concerned that your developers might change the underlying tables' structure and cause problems in the view. How can you ensure they do not change the underlying tables without also changing the view and not disrupt their workflow?

Answer: Use the SCHEMABINDING option in the CREATE VIEW statement.

Explanation: The best way to ensure this is to use the SCHEMABINDING option when creating the view. This ensures that the underlying tables' schema cannot be changed. The view must be dropped or altered to allow the changes


You have a large table for your customers that contains the name, address, contact data, and past orders in columns. There are 24 past orders columns listed as PastOrder1, PasterOrder2, ..., PastOrder24. You want to partition these past orders columns into a new table. What type of partitioning is this?

Answer: Vertical partitioning.

Explanation: This is an example of vertical partitioning of a table. You are moving columns to a new table, which is like making a vertical slice through the table data. Both table contain the same number of rows, but different columns.


What does this code return?
select 6 | 7
Figure it out without running it.

Answer: 7

Explanation: This returns a 7, which is the result of an Inclusive OR between these numbers. These numbers are:
6 - 0110
7 - 0111
If you OR these numbers, you get a 7, which is 0111, all bits with 1s anywhere are returned.


What is an example of hardware partitioning?

Answer: Using multiple CPUs to handle the workload.

Explanation: Hardware partitioning involves using the hardware architecture to divide the load. Examples would be multiple processors to run multiple threads of execution, multiple disk drives to service requests, multiple network cards to handle incoming data.

(Continued on next part...)

Part:   1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36  37  38  39  40  41