MS SQL Server Concepts and Programming Question:
Download Questions PDF

Can We Delete Data from a View?

Answer:

Can you delete data in a view? The answer is no.

But if the question is "Can you delete data from the underlying table through view?" The answer is then yes. SQL Server will allow you to delete data from the underlying table through a view. The tutorial exercise below is a good example:

DELETE FROM ggl_links_top WHERE id = 100001;
GO

SELECT * FROM ggl_links_top;
GO
36470 999966 dgqnvmy pyjqd toqcoupuxortasdtzvcae jonfb
12292 999953 qebmw v qqmywe q kza wskxqns jnb
6192 999943 p o qisvrakk hk od

SELECT TOP 1 * FROM ggl_links ORDER BY counts DESC;
GO
<pre>id url ...
------ ------------------------------------------- ...
36470 dgqnvmy pyjqd toqcoupuxortasdtzvcae jonfb ...</pre>

Download MS SQL Server Interview Questions And Answers PDF

Previous QuestionNext Question
Can We Update Data in a View?How To Assign New Column Names in a View?