PrepAway - Latest Free Exam Questions & Answers

Which four Transact-SQL statements should you use?

DRAG DROP
You create a view based on the following statement:

You grant the Select permission to User1 for this view. You need to change the view so that
it displays only the records that were processed in the month prior to the current month. You
need to ensure that after the changes, the view functions correctly for User1. Which four
Transact-SQL statements should you use? (To answer, move the appropriate SQL
statements from the list of statements to the answer area and arrange them in the correct order.)

PrepAway - Latest Free Exam Questions & Answers

Answer:

Explanation:
http://msdn.microsoft.com/en-us/library/hh213020.aspx
http://msdn.microsoft.com/en-us/library/ms186819.aspx
http://msdn.microsoft.com/en-us/library/ms173846.aspx

3 Comments on “Which four Transact-SQL statements should you use?

  1. pjotr says:

    .. the answer is not completely wrong, but the other WHERE-condition should be used for sure !

    Reason
    ====================================================
    SELECT EOMONTH (@STARTDATE, -1) AS LastMonthLastDay

    results for instance in

    LastMonthLastDay
    ———————–
    2011-11-30 00:00:00.000

    @see http://www.mssqltips.com/sqlservertip/2588/new-date-and-time-functions-in-sql-server-2012/

    The time-info in the result points always to the BEGINNING of the day of interest !

    But in this case we do urgently need all data till the END of this day.
    Therefore we should add 1 day to the result of EOMONTH-expression and consider all results before this point-in-time
    -> i.e. ‘b.ProcessDate < dateadd(d, 1, EOMONTH(GETDATE(), -1))'

    This solution is favorized by 'http://www.examcollection.com/microsoft/Microsoft.Certkiller.70-462.v2014-09-11.by.LARA.169q.vce.file.html&#039;




    0



    0
  2. artis says:

    I got one new question about security
    I cant remember exact question, but you will understand if you see one.
    You administer SQL 2012 server, only web application will connect to this server.
    you need to minimize attack chance
    (need to check all that apply)
    1) install named database instance;
    2) all services will start with same account;
    3) install sql database in windows server core 2008 r2;
    4) services starts automatically.
    5) cant remember this one

    I dont know the answers.




    0



    0
  3. Slazenjer_m says:

    “only the records that were processed in the month prior to the current month…”

    b.processdate < dateadd(d, 1, EOMONTH(GETDATE(), -1))

    GETDATE() :returns current month
    GETDATE(), -1 :returns month prior to current month
    EOMONTH(GETDATE(), -1) :returns last day of month prior to current month
    dateadd(d, 1, EOMONTH(GETDATE(), -1)) :returns '1 day after' previous month's last day




    0



    0

Leave a Reply