Tuesday, January 28, 2014

Schema Bind View

When a view is specified with SCHEMABINDING option, you cannot modify the base tables the view uses such that the view is affected. Also, you cannot drop the tables used inside the view unless you drop the view first. You cannot also use ALTER TABLE statements on the tables used by the view. All referenced objects must belong to the same database.


more information can be found here... http://ift.tt/1fameF5


To create a SCHEMA BINDING View you will use the syntax



CREATE VIEW dbo.VW_Name WITH SCHEMABINDING AS
SELECT statement..

Now that you used SCHEMABINDING on the view, if you try to ALTER the referenced table it will throw any error.


Please mark as answer, if this helped you resolving your issue.


Good Luck :) .. Visit www.sqlsaga.com for more t-sql code snippets and BI related how to articles.


No comments:

Post a Comment