View Not Upgradable in SQL Server

1

    
asked by anonymous 12.04.2017 / 18:55

2 answers

1

The CREATE VIEW documentation contains something about updatable views and what are the rules for getting them. By breaking any of the rules, it seems to me that we have an unrealizable view.

For example:

   -- código #1   
   CREATE VIEW nome_da_exibição as  
   SELECT colunas 
     from nome_tabela
   union all  
   SELECT colunas 
     from nome_tabela  
     where 1 = 0;  
   go

You can also use trigger procedure (of type INSTEAD OF) to block execution of INSERT, UPDATE, and DELETE on the call from the view.

To delve deeper into the topic, search the web for sql server view readonly .

    
12.04.2017 / 21:03
0

The most performatic form I know is:

CREATE VIEW MinhaView
AS
SELECT TOP 100 PERCENT Coluna1, Coluna2, Coluna3
FROM tabela
WITH CHECK OPTION
    
12.04.2017 / 21:16