I have to 2 databases DB1
and DB2
.
I have a view called View1
which is stored in the database DB2
. Now I want to ALTER VIEW
from DB1
database.
My attempt:
ALTER VIEW DB2..View1
AS
SELECT * FROM DB2..Test;
But I'm getting an error:
'CREATE/ALTER VIEW' does not allow specifying the database name as a prefix to the object name
DB2
, you need to be inDB2
to alter it. – RenterDB1
? – GhiselinDB2
? – Kienan