Delete a SQL VIEW Object

How do i Delete a SQL View object once I create the view.

Once I run this query and it creates the view:

USE DATBS_A
GO
CREATE VIEW SUMMARY AS
SELECT person_no, assignment_no, start_date
FROM summary
WHERE role = 'Worker'

How can i remove the view so I can execute the same statement?
LVL 3
TAMSCODANAsked:
Who is Participating?
 
auke_tConnect With a Mentor Commented:
The view seems to have the same name as the table. This isn't possible!

CREATE VIEW
vw_SUMMARY
AS
SELECT person_no, assignment_no, start_date
FROM summary
WHERE role = 'Worker'

--and if you want to remove the view again:

drop view vw_summary
0
 
Anthony PerkinsCommented:
DROP VIEW SUMMARY
0
 
Anthony PerkinsCommented:
Or if all you want to do is modify it then:

ALTER VIEW SUMMARY AS
...
0
Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

 
TAMSCODANAuthor Commented:

USE DATBS_A
GO
DROP VIEW SUMMARY
GO
CREATE VIEW SUMMARY AS
SELECT person_no, assignment_no, start_date
FROM summary
WHERE role = 'Worker'


When i do this now it looks like the query is running ok, however I am not getting any results, wne I run the view over
0
 
p_nutsCommented:
what is the difference between the new and the old view
0
 
TAMSCODANAuthor Commented:
Basically that was one of my requirements to ensure it checks to see if there is an old and update it with the new. I got most of it done but dont seem to figure out why my data is not appearing. It doesnt appear at all, but only when i run hte SELECT statement by itself. if i run the entire thing, Query was done succesfully however i dont see the results.
0
 
Anthony PerkinsCommented:
There seems to be some confusion here:
CREATE VIEW: Creates the view it does not execute it.  In order to execute it you need to do something like this:
SELECT person_no, assignment_no, start_date
FROM SUMMARY
0
All Courses

From novice to tech pro — start learning today.