taLength(@IndDesc) - 1 ) Select @Script = @Script + '''' WITH '''' + @IndDesc end /* ** Add the location of the data. */ if @Segment <> 1 select @Script = @Script + '''' ON '''' + name from syssegments where segment = @Segment end if (@strPri_Key = '''''''') Insert into #spscript values(@Script,0) else update #spscript set Script = Script + @strPri_Key where LastLine = 1
Fetch Next from Cursor_Index into @ColName, @IndID, @IndStatus, @Segment end Close Cursor_Index Deallocate Cursor_Index