Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

convert anonymous block to a stored procedure that will accept a date as input and print the original date, the date after one year, week

image text in transcribedconvert anonymous block to a stored procedure that will accept a date as input and print the original date, the date after one year, week and day. Execute your stored procedure. Examples of execution.

2. Must be completed and tested or -2 points (not graded, used to prepare you for graded DECLARE Qdate DATETIME SET @date- getdateO; -- set @date as current date SELECT @date as 'Current Date', display current date assignment #3) Run the following T-SOL code DATEADD(year, 1, Qdate) AS 'Plus one Year', DATEADD (week, 1, adate) AS Plus one week', DATEADD(day, 1, Qdate) AS 'Plus one Day' Modify code: convert anonymous block to a stored procedure that will accept a date as input and print the original date, the date after one year, week and day Execute your stored procedure. Examples of e xecutiorn declare ia datetime SET @a getdate(); exec date procedure a SET @a =CAST(' 10-JAN-2017' as datetime); exec date presedure @a; 100 % Messages Original date Jan 12 2015 4:47PM A year later Jan 12 2016 4:47PM A week later Jan 19 2015 4:47PM A day later Jan 13 2015 4:47PM Original date Jan 10 2017 12:00AM A year later Jan 10 2018 12:00AM A week later Jan 17 2017 12:00AM A day later Jan 11 2017 12:00AM

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Modeling And Design

Authors: Toby J. Teorey, Sam S. Lightstone, Tom Nadeau, H.V. Jagadish

5th Edition

0123820200, 978-0123820204

More Books

Students also viewed these Databases questions

Question

4. Describe cultural differences that influence perception

Answered: 1 week ago