Script:
CREATE TABLE dbo.customers (cID INT, Cname VARCHAR(10), city varchar(10))
GO
insert into customers values (1,'harsha','hyd')
insert into customers values (2,'varsha','hyd')
CREATE VIEW dbo.viewersfirst
WITH SCHEMABINDING
AS
SELECT CID , city
FROM dbo.customers
GO
select * from dbo.viewersfirst
DROP TABLE dbo.customers
GO
ALTER VIEW dbo.viewersfirst
AS
SELECT cID, city
FROM dbo.customers
GO
DROP TABLE dbo.customers
GO
select * from dbo.viewersfirst
Don't forget to subscribe to our channel.
/ tricksthatmakesmart
/ tricksthatmakeyousmart
/ tricksthatmakeyousmart