Problem:
Today I Tried to Create a View WITH SCHEMABINDING then i received the following error.
I used the following Query:Msg 4512, Level 16, State 3, Procedure VIEW_CLIENT_GLOBAL, Line 4
Cannot schema bind view 'VIEW_CLIENT_GLOBAL' because name 'FACT_CLIENT_GLOBAL' is invalid for schema binding. Names must be in two-part format and an object cannot reference itself.
Solution:
I think, you aware the use of "WITH SCHEMABINDING". If Not, Please Check My Post Here
By Error message Itself we can find out what is wrong.
When You Create a view "WITH SCHEMABINDING", Database will keep the reference with object name. many database object can be created with same name from difference user, if we create the view by using only name. There are lot of difficulties to handle. To avoid that, SQL Server expects the Object Name in Proper Format like
Owner.Object_Name.
In My Query I changed to DBO.FACT_CLIENT_GLOBAL, then i tried to create the view then it works fine.
Note: Also You have to Ensure that your Table and View should be exists in the Same Database, if you are Enabling "WITH SCHEMABINDING". Otherwise you may get the same error message
Hope it Helps you!
