创建或替换视图
此查询将删除视图(如果已存在)并创建一个新视图。
IF OBJECT_ID('dbo.PersonsView', 'V') IS NOT NULL
DROP VIEW dbo.PersonsView
GO
CREATE VIEW dbo.PersonsView
AS
SELECT
name,
address
FROM persons;
此查询将删除视图(如果已存在)并创建一个新视图。
IF OBJECT_ID('dbo.PersonsView', 'V') IS NOT NULL
DROP VIEW dbo.PersonsView
GO
CREATE VIEW dbo.PersonsView
AS
SELECT
name,
address
FROM persons;