exam questions

Exam 70-761 All Questions

View all questions & answers for the 70-761 exam

Exam 70-761 topic 1 question 179 discussion

Actual exam question from Microsoft's 70-761
Question #: 179
Topic #: 1
[All 70-761 Questions]

Note: This question is part of a series of questions that use the same or similar answer choices. An answer choice may be correct for more than one question in the series. Each question is independent of the other questions in this series. Information and details provided in a question apply only to that question.
You have a table named Person that contains information about employees. Users are requesting a way to access specific columns from the Person table without specifying the Person table in the query statement. The columns that users can access will be determined when the query is running against the data. There are some records that are restricted, and a trigger will evaluate whether the request is attempting to access a restricted record.
You need to ensure that users can access the needed columns while minimizing storage on the database server.
What should you implement?

  • A. the COALESCE function
  • B. a view
  • C. a table-valued function
  • D. the TRY_PARSE function
  • E. a stored procedure
  • F. the ISNULL function
  • G. a scalar function
  • H. the TRY_CONVERT function
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️
References:
https://docs.microsoft.com/en-us/sql/t-sql/statements/create-view-transact-sql?view=sql-server-2017

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Prides
Highly Voted 5 years, 3 months ago
trigger are supported only on tables, views, schema or database, not on functions
upvoted 10 times
tzaganczyk
4 years, 6 months ago
That's true, but going deeper in details: what kind of trigger can be used here, when users only want to query the data (access doesn't explicitly mean altering the data, I suppose)? None of DDL, DML or logon triggers will give the opportunity to "evaluate whether the request is attempting to access a restricted record" in case of querying the data. If "access" means altering the data, then the view is the best answer.
upvoted 1 times
...
...
Vermonster
Most Recent 4 years, 4 months ago
Best answer is to write an INSTEAD OF trigger on a VIEW to do everything require. Can't do on a function
upvoted 1 times
...
SimSql
4 years, 4 months ago
The answer is View!
upvoted 1 times
...
MOAMMI
4 years, 5 months ago
this is a table value function.
upvoted 1 times
...
eduardogtc
4 years, 7 months ago
I think the answer is store procedure, because: 1) it can run a dynamic SQL (functions can't), because the columns will be defined dynamically. 2) it can save the invalid access in a table (Functions can't_
upvoted 2 times
...
anonimdom
5 years, 3 months ago
Can views do that: "The columns that users can access will be determined when the query is running against the data."? It looks like some logic should be implemented to determine the columns, so possibly a table valued function can do that.
upvoted 2 times
MarcusJB
5 years, 2 months ago
I had the exact same thoughts. I would be interested in how this could be implemented exactly. No problem with a table valued function, but how you would do this with a trigger?
upvoted 1 times
...
Andy7622
4 years, 4 months ago
When you running a view I don't see the columns : SELECT * FROM vView
upvoted 1 times
Andy7622
4 years, 4 months ago
Sorry I meant when you're running ... You don't see
upvoted 1 times
...
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago