Collections:
Updating Data in a View in SQL Server
Can You Update Data in a View in SQL Server?
✍: FYIcenter.com
Can you update data in a view? The answer is no.
But if the question is "Can you update data in the underlying table through view?" The answer is then yes. SQL Server will allow you to update data in the underlying table through a view. The tutorial exercise below is a good example:
UPDATE fyi_links_top SET url = REVERSE(url) WHERE id = 100001; GO SELECT * FROM fyi_links_top; GO id counts url ------ ------- ------------------------------------------- 100001 1000001 moc.retneciyf.abd 36470 999966 dgqnvmy pyjqd toqcoupuxortasdtzvcae jonfb 12292 999953 qebmw v qqmywe q kza wskxqns jnb SELECT TOP 1 * FROM fyi_links ORDER BY counts DESC; GO id url notes counts created ------ ----------------- ----- ----------- ---------- 100001 moc.retneciyf.abd NULL 1000001 2007-05-19
2016-11-04, 800👍, 0💬
Popular Posts:
How to download and install the scaled-down database AdventureWorksLT in SQL Server? If you want to ...
What are DDL (Data Definition Language) statements for tables in SQL Server? DDL (Data Definition La...
How To Create a View on an Existing Table in SQL Server? If you want to a view on an existing table,...
How To Import One Table Back from a Dump File in Oracle? If you only want to import one table back t...
How To Find Out What Privileges a User Currently Has in Oracle? Privileges granted to users are list...