在创建视图时如何包含命名空间和schemabinding?

时间:2013-02-12 22:06:17

标签: sql-server sql-server-2008 tsql sql-server-2012

您将如何包含SCHEMABINDING以及XMLNAMESPACES

CREATE View [dbo].[GetSomething] As

WITH XMLNAMESPACES ( 'http://www.something.com/some.xsd' AS gev)

-- How to include SCHEMABINDING--

SELECT 

2 个答案:

答案 0 :(得分:2)

CREATE View [dbo].[GetSomething] 
WITH SCHEMABINDING
AS

WITH XMLNAMESPACES ( 'http://www.something.com/some.xsd' AS gev)

SELECT -- Make sure your select follows the rules for schemabinding of course

答案 1 :(得分:1)

CREATE VIEW dbo.Something WITH SCHEMABINDING AS 

WITH XMLNAMESPACES