The database will contain a table. Customer data are stored in the table as XML data. The data supports an
application that cannot be altered. You plan to prevent the types of errors below in the XML data: Invalid values
in the Gender field, NULL values in the Customer Name field, Non-numeric values in the Customer Telephone
field.
What should you do to implement the plan while not modifying the application?
The database will hold incoming XML responses for an EDI system. You have the requirements for the
database: The database is scalable and accessible to heterogeneous platforms. The database stores large
amounts of data and various types of reports from multiple sources. The solution allows search by keywords.
So what should you do to make the database to meet these requirements?
You own the Sales schema and a user named MarketingMan is the owner of the Marketing schema. You are
allowed to create objects in all schemas in the database. But users of the Marketing schema are not allowed to
access the Sales schema which has a table named Clients. In the Marketing schema, you intend to create a
stored procedure for the marketing team. The stored procedure will select data from the Clients table and will
be owned by MarketingMan.
What should you do to make sure that the marketing team is able to execute the stored procedure?
A common language runtime (CLR) user-defined scalar function will be contained in the database. An integer
value will be returned by the function.
What should you do to make sure that the computed columns that use the result from this function can be
indexed?
You plan to create a stored procedure. The procedure produces forecast data and queries a sales table. You
don't own the database and you do not have administrative permissions, but you are allowed to create stored
procedures. Users will only be allowed to execute your stored procedures.
What should you do to make sure that users can execute the stored procedures?
There's a database contains a view. This view contains a WHERE clause that filters specific records and allows
data updates. You have to prevent data modifications which do not conform to the WHERE clause while using
as little effort as possible.
So what should you do?
There's a database that contains a table. Besides this, it also contains a table-valued function which accepts
the primary key from the table as a parameter. You intend to write a query. The query joins the table to the
results of the table-valued function. You must make sure that rows from the table returned are only those
produce a result set from the table-valued function.
So which join predicate should you choose to use?
You use SQL Server 2008 to create an online transaction processing (OLTP) database in an enterprise
environment. A table named SellingData is contained in the database. Each record in the table contains data in
any one of the following pairs of nullable columns:
ForeignSellingTargets and ForeignSelling, InternetSellingTargets and InternetSelling, ResellerSellingTargets
and ResellerSelling.
There're three NOT NULL key columns in the table. A large number of records are inserted on a daily basis into
the SellingData table. From the SellingData table, summary reports are generated, each of which is based on
aggregated data from any one of the pairs of nullable columns. The requirements below must be satisfied:
The SellingData table cannot be directly modified. The performance of the reports is maximized. The amount of
storage space for each report is minimized.
You have to design a view or views to meet these requirements.
So what should you do?
A stored procedure that uses the TRY/CATCH syntax is created in a new database. When the stored
procedure is executed, the store procedure logs information about each step in the TRY block into a table when
it is executed, the table is named dbo.RunningLog. If an error happens, the stored procedure must roll back the
changes made to the
target tables and retain the log entries stored in the dbo.RunningLog table.
So what should you do to make sure that the given tasks can be performed by the stored procedure?
A table named PurchaseCustoms which has no indexes contained in your data warehouse. A table named
SellRequests is contained in your online transaction processing (OLTP) database. Data between the two tables
has to be synchronized on a weekly basis. The following are requirements for the synchronization process:
New records in the SalesOrders table are inserted in the factBuyingHabits table.
Records that are deleted from the SalesOrders table are also deleted from the factBuyingHabits table.
When a record is modified in the SalesOrders table, the modification is updated in the factBuyingHabits table.
You have to design a suitable synchronization solution while using as little coding and administrative efforts as
possible.
So what should you do?