View does not appear in query - Sql Server

Asked

Viewed 240 times

-1

I have a 2-field view that does not appear in the query window. When I add 3 more fields, it appears. What can be?.

View:

SELECT        B.TX_LOGIN, COUNT(A.CD_PROCESSO) AS TOTAL
FROM            dbo.TB_DUE_CAPA AS A INNER JOIN
                         dbo.TB_USUARIOS AS B ON A.CD_USUARIO_CRIACAO = B.CD_USUARIO
WHERE        (MONTH(A.DT_PROCESSO) = MONTH(GETDATE())) AND (YEAR(A.DT_PROCESSO) = YEAR(GETDATE()))
GROUP BY B.TX_LOGIN

View Criada

View does not appear in window:

View não aparece na janela

Permissions by the User: Permissões do Usuário

inserir a descrição da imagem aqui

  • Have you tried right-clicking on the folder views and click to reload?

3 answers

0

Edit -> Intellisense -> Refresh Local Cache

Or the shortcut:

CTRL + SHIFT + R

  • 1

    to show a new/changed object? a refresh does not solve?

  • Yes, I completely forgot about that detail. I edited the question.

0

Are you sure View already exists?

To delete the existing do:

DROP VIEW IF EXISTS Nome_da_View;

To recreate do:

CREATE VIEW Nome_da_View AS  
SELECT B.TX_LOGIN, COUNT(A.CD_PROCESSO) AS TOTAL
FROM   dbo.TB_DUE_CAPA AS A INNER JOIN
       dbo.TB_USUARIOS AS B ON A.CD_USUARIO_CRIACAO = B.CD_USUARIO
WHERE  (MONTH(A.DT_PROCESSO) = MONTH(GETDATE())) AND (YEAR(A.DT_PROCESSO) = YEAR(GETDATE()))
GROUP BY B.TX_LOGIN;

Check the permissions of views of the database objects, as it may be that you n~]when have.

Also check what @Lockzera said, because it wouldn’t surprise me if it happens to windows even...

  • I’ve tried that, but it’s still the same. I’ll include an image of the sql server user permissions

-1

There is a Bug in SQL Server when windows 10 'suspends activity'( when it is long without moving and ends up hibernating) sql server Buga, just restart the machine.

  • 3

    restart the SQL server? what solution is this? where is documented this alleged bug?

  • restart the machine that is with sql server, where it is documented I do not know kkkk, but this bug happens a lot, both with viwers and any other creation that Oce do, they are done but it is not shown in the navigation on the left side, it is windows 10 bug

  • I understand what you mean, but see that the question does not even say that it is windows 10, what if it is happening in windows server? what I mean is that the answer was very inconclusive

Browser other questions tagged

You are not signed in. Login or sign up in order to post.