Search this blog

Wednesday, January 20, 2010

SQL SCHEMABINDING Error - Names must be in two-part format and an object cannot reference itself


Problem:
Today I Tried to Create a View WITH SCHEMABINDING then i received the following error.

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.
I used the following Query:


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!

Tuesday, January 12, 2010

Visual Studio 2010 and .NET Framework 4 Training Kit - January Release




The Visual Studio 2010 and .NET Framework 4 Training Kit includes presentations, hands-on labs, and demos. This content is designed to help you learn how to utilize the Visual Studio 2010 features and a variety of framework technologies including:
  • C# 4.0
  • Visual Basic 10
  • F#
  • Parallel Extensions
  • Windows Communication Foundation
  • Windows Workflow
  • Windows Presentation Foundation
  • ASP.NET 4
  • Windows 7
  • Entity Framework
  • ADO.NET Data Services
  • Managed Extensibility Framework
  • Visual Studio Team System
This version of the Training Kit works with VS 2010 Beta 2 & .NET Framework 4 Beta 2.