What should you do to correct the following problem?

You work as a database administrator at Domain.com. Domain.com is using a SQL Server
2008 instance. The SQL Server 2008 instance contains a database named CK_DB that has a
stored procedure which is as follows:

1 CREATE PROCEDURE Products.TestProcedure
2 AS
3 IFOBJECT_ID(‘ Products. TableTest1’) IS NOT NULL
4 DROPTABLE Products.TableTest1;
5
6 CREATE TABLE Products. TableTest1 (
7 Idint PRIMARY KEY CLUSTERED,
8 Namevarchar(100);
9 );
10
11 …
12 GO

However, a Domain.com user has called the TestProcedure and received the following:

Msg 262, Level 14, State 1, Procedure TestProcedure, Line 15CREATE TABLE permission
permitted in database ‘ CK_DB ‘."

You need to correct the problem. What should you do?

You work as a database administrator at Domain.com. Domain.com is using a SQL Server
2008 instance. The SQL Server 2008 instance contains a database named CK_DB that has a
stored procedure which is as follows:

1 CREATE PROCEDURE Products.TestProcedure
2 AS
3 IFOBJECT_ID(‘ Products. TableTest1’) IS NOT NULL
4 DROPTABLE Products.TableTest1;
5
6 CREATE TABLE Products. TableTest1 (
7 Idint PRIMARY KEY CLUSTERED,
8 Namevarchar(100);
9 );
10
11 …
12 GO

However, a Domain.com user has called the TestProcedure and received the following:

Msg 262, Level 14, State 1, Procedure TestProcedure, Line 15CREATE TABLE permission
permitted in database ‘ CK_DB ‘.”

You need to correct the problem. What should you do?

A.
You should consider changing the CREATE TABLE permission.

B.
You should consider adding the WITH EXECUTE AS ‘dbo’ clause between lines 1 and 2.

C.
You should consider adding the ALTER permission on the Products schema to the user.

D.
You should consider adding the WITH EXECUTE AS ‘dbo’ clause between lines 3 and 4.



Leave a Reply 0

Your email address will not be published. Required fields are marked *