CodeCopy

October 1, 2009

mssql creating index on view

Filed under: SQL — sterndorff @ 09:50
Tags: , ,

You have a fulltext index on a view. If you edit one of the tables that is in the view, Sql Server Manager will drop the index. When recreating the view you might get the error:

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

Solution: You have to drop the view and recreate with schemabound

CREATE VIEW [dbo].[T_IC_USERS_1] WITH SCHEMABINDING  
AS  
SELECT U.APP_ID,U.CREATED_BY,U.CREATED_TIME,U.LOWERED_USER_NAME  
  FROM   dbo.T_IC_USERS AS U  
  WHERE  (IS_DELETED = '0')  
GO  

Theme: Rubric. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.