Добро пожаловать в форум, Guest  >>   Войти | Регистрация | Поиск | Правила | В избранное | Подписаться
Все форумы / Microsoft SQL Server Новый топик    Ответить
 Ошибка при REBUILD  [new]
Shovgenyuk
Member

Откуда: Ивано-Франковск-Киев
Сообщений: 467
Есть таблица:
CREATE TABLE [dbo].[LstPersonal](
	[IDRec] [smallint] IDENTITY(1,1) NOT NULL,
	[AutoComplit] [int] NULL,
	[SurnameL] [varchar](30) NULL,
	[NameL] [varchar](20) NULL,
	[PartnameL] [varchar](30) NULL,
	[ViddilPol] [smallint] NULL,
	[viddil] [smallint] NULL,
	[Marker] [bit] NOT NULL,
	[TablNomer] [varchar](50) NULL,
	[Zaklad] [int] NULL,
	[KOD] [int] NULL,
	[Blok] [bit] NOT NULL,
	[PIPL]  AS (isnull([SurnameL],'') + ' ' + isnull([NameL],'') + ' ' + isnull([PartnameL],'')),
	[Cement] [tinyint] NOT NULL,
	[IdRecG] [uniqueidentifier] ROWGUIDCOL  NOT NULL,
	[KodI] [int] NULL,
	[Hash] [varchar](900) NULL,
	[PIPS]  AS ((case when [SurnameL] IS NULL 
                        then ''
                        else [SurnameL] 
                        end+
                        case when [NameL] IS NULL OR [NameL]='' 
                        then '' 
                        else (' '+upper(left([NameL],(1))))+'.' 
                        end)+
                        case when [PartnameL] IS NULL OR [PartnameL]='' 
                        then '' 
                        else (' '+upper(left([PartnameL],(1))))+'.' 
                        end) 
       PERSISTED,	[NotInShtat] [tinyint] NULL,
 CONSTRAINT [PK_Personal] PRIMARY KEY CLUSTERED 
([IDRec] ASC) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]) ON [PRIMARY]



ALTER INDEX PK_Personal ON dbo.LstPersonal REBUILD 


Выдаёт:
Msg 1934, Level 16, State 1, Line 1
ALTER INDEX failed because the following SET options have incorrect settings: 'ANSI_PADDING'. Verify that SET options are correct for use with indexed views and/or indexes on computed columns and/or filtered indexes and/or query notifications and/or XML data type methods and/or spatial index operations.


Что за ошибка и как её исправить?
18 ноя 14, 00:04    [16862491]     Ответить | Цитировать Сообщить модератору
 Re: Ошибка при REBUILD  [new]
o-o
Guest
SET Options That Affect Results
у вас вычисляемый столбец PERSISTED,
выставьте сессии
set ANSI_PADDING ON
перед ребилдом
18 ноя 14, 01:25    [16862672]     Ответить | Цитировать Сообщить модератору
Все форумы / Microsoft SQL Server Ответить