Indexed View in Sql Server 2005 Error

I tried adding an index to the view in Sql Server 2005 and received this error: "It is not possible to create an index in the view" AllAssignmentNotes "because the view is not connected to a schema."

I did not want to post too much information here, as it could be overload. Just wondering if anyone can help me.

I went over to the URL that the error gave me and did not give me anywhere. Full error below.

I know that you cannot give a real answer, because I did not give you all the information, my apologies.

TITLE: Microsoft SQL Server Management Studio
------------------------------

Create failed for Index 'IX_AssignmentId'. (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.4035.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Create+Index&LinkI20

------------------------------
ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

------------------------------

Cannot create index on view 'AllAssignmentNotes' because the view is not schema bound. (Microsoft SQL Server, Error: 1939)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.4035&EvtSrc=MSSQLServer&EvtID=1939&LinkId=20476

------------------------------
BUTTONS:

Ok
------------------------------
+3
source share
4 answers

, , . ,

create view with schemabinding.

, int, schemaname, .. dbo.table,

+5

, WITH SCHEMABINDING, , SET, ON CREATE INDEX:

ANSI_NULLS 
ANSI_PADDING 
ANSI_WARNINGS 
ARITHABORT 
CONCAT_NULL_YIELDS_NULL 
QUOTED_IDENTIFIERS 

NUMERIC_ROUNDABORT OFF.

+1

Working with indexed views has been a big pain since they were introduced. The rules actually make a view that supports indexing very strict, and error messages are useless.

You should check out BOL http://msdn.microsoft.com/en-us/library/ms191432(sql.90).aspx

+1
source

Source: https://habr.com/ru/post/1708687/


All Articles