I ran the sql 2005 instcat.sql on an old sql 6.5.
There were a few errors.... seems there is some problem with the [UNIQUE] brackets.
one of which involved SP_INDEXES.
Any help? Can I ignore this and others errors?
Thanks,
Tom N.
The error was...
Msg 170, Level 15, State 1
Line 13: Incorrect syntax near '['.
Msg 208, Level 16, State 2
Invalid object name 'sp_indexes'.
when the procedure had....
create procedure sp_indexes(
@table_server sysname,
@table_name sysname = null,
@table_schema sysname = null,
@table_catalog sysname = null,
@index_name sysname = null,
@is_unique bit = null)
as
select
TABLE_CAT = TABLE_CATALOG,
TABLE_SCHEM = TABLE_SCHEMA,
TABLE_NAME = TABLE_NAME,
NON_UNIQUE = convert(smallint, 1 - [UNIQUE]),
INDEX_QUALIFIER = TABLE_NAME,
INDEX_NAME = INDEX_NAME,
TYPE =
case [CLUSTERED]
when 1 then 1
else 3
end,
ORDINAL_POSITION = ORDINAL_POSITION,
COLUMN_NAME = COLUMN_NAME,
ASC_OR_DESC =
case [COLLATION]
when 1 then 'A'
when 2 then 'D'
else null
end,
CARDINALITY = CARDINALITY,
PAGES =
case [CLUSTERED]
when 1 then PAGES
else NULL
end,
FILTER_CONDITION = FILTER_CONDITION
from master.dbo.SYSREMOTE_INDEXES (
@table_server,
@table_catalog,
@table_schema,
@index_name,
NULL, /* TYPE (index type) */
@table_name )
where @is_unique is null or @is_unique = [UNIQUE]
order by NON_UNIQUE, TYPE, INDEX_QUALIFIER, INDEX_NAME, ORDINAL_POSITION
go
grant execute on sp_indexes to public
go
|