A question From 70-762 I got seems all four options are correct?

Eric0117Eric0117 Member Posts: 1 ■■□□□□□□□□
You create a view based on the following statement:

CREATE VIEW vwBatchList
AS 
SELECT b.BatchID, b.MailItemID, C.ContractNum, C.FirstName + ' ' + C.LastName AS ContractName, a.address1, 
a.City + ','+ a.State +' ' + a.Zip
FROM BatchLog AS b 
JOIN Contract AS c ON b.MailItemID=c.ContractID
JOIN Address AS a ON a.ContractID=c.ContractID
WHERE 
b.Processdate >= dateadd(day, 1, EOMONTH(GETDATE(), -2));

You grant the Select permission to User1.
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 Transact-SQL statement should you use?

A.         DROP VIEW vwBatchList
            GO
            CREATE VIEW vwBatchList
            AS 
            SELECT 
           -------
           WHERE 
           b.Processdate >= dateadd(day, 1, EOMONTH(GETDATE(), -2))
           AND b.Processdate <dateadd(day, 1, EOMONTH(GETDATE(), -1))


B.         AlTER VIEW vwBatchList
            AS 
            SELECT 
           -------
           WHERE 
           b.Processdate >= dateadd(day, 1, EOMONTH(GETDATE(), -2))
           AND b.Processdate <= EOMONTH(GETDATE(), -1)

C          ALTER VIEW vwBatchList
            AS 
            SELECT 
           -------
           WHERE 
           b.Processdate >= dateadd(day, 1, EOMONTH(GETDATE(), -2))
           AND b.Processdate <dateadd(day, 1, EOMONTH(GETDATE(), -1))

D        DROP VIEW vwBatchList
           GO
           CREATE VIEW vwBatchList
            AS 
            SELECT 
           -------
           WHERE 
           b.Processdate >= dateadd(day, 1, EOMONTH(GETDATE(), -2))
           AND b.Processdate <= EOMONTH(GETDATE(), -1)
           



Sign In or Register to comment.