lin2world_index_create.sql: Код: USE [lin2world] GO /****** Object: StoredProcedure [dbo].[lin_Reindex] Script Date: 10/07/2006 06:00:20 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE [dbo].[lin_Reindex] AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; DECLARE @TableName varchar(255) DECLARE TableCursor CURSOR FOR SELECT table_name FROM information_schema.tables WHERE table_type = 'base table' OPEN TableCursor FETCH NEXT FROM TableCursor INTO @TableName WHILE @@FETCH_STATUS = 0 BEGIN DBCC DBREINDEX(@TableName,' ',90) FETCH NEXT FROM TableCursor INTO @TableName END CLOSE TableCursor DEALLOCATE TableCursor END lin2world_index_exec.sql: Код: DECLARE @RC int EXECUTE @RC = [lin2world].[dbo].[lin_Reindex]