Steps to reproduce:
1) Execute this script using any tool
create table t1(a int)
2) Start ODBCTEST and login in to SQL Server. Run this query (I simply click
on the exclamation point)
alter index index_junk on t1 rebuild
3) Review the output:
Return: SQL_ERROR=-1
stmt:szSqlState = "42S21", *pfNativeError = 2727, *pcbErrorMsg = 73,
*ColumnNumber = -1, *RowNumber = 1
MessageText = "[Microsoft][SQL Native Client][SQL Server]Cannot find index
'index_junk'."
My configuration:
SQL Server 2005 IDW12 (I believe)
SQL Native Client dirver that comes with it.
The same error exist with I use SQL ODBC Driver that comes with MDAC 2.8. I
have not tried SQL Server 2000, but I believe this error code mapping occurs
in ODBC on the client side and Server should not make a difference.
--Aleksey
[quoted text, click to view] "Bei Zhu [MSFT]" wrote:
> Could you please provide more info? Like index_junk and table creation.
>
> "Aleksey Dmitriyev" <AlekseyDmitriyev@discussions.microsoft.com> wrote in
> message news:981E61BC-DB8B-4DE3-A21A-6FFEE2824DF2@microsoft.com...
> > I get SQLSTATE 42S21 with native code 2727 when executing this query:
> >
> > alter index index_junk on testauto rebuild
> >
> > According to ODBC documentation the SQLSTATE should be 42S12 "Index not
> > found", not 42S21 "Column already exists". Is it a bug?
> >
> > --
> > -- Aleksey Dmitriyev
>
>
You need to create index index_junk first, then you can alter it.
"Aleksey Dmitriyev" <AlekseyDmitriyev@discussions.microsoft.com> wrote in
message news:37C76DB7-59CC-4C63-BBF6-67ED7D9C2F81@microsoft.com...
[quoted text, click to view] > Steps to reproduce:
>
> 1) Execute this script using any tool
> create table t1(a int)
>
> 2) Start ODBCTEST and login in to SQL Server. Run this query (I simply
click
> on the exclamation point)
> alter index index_junk on t1 rebuild
>
> 3) Review the output:
> Return: SQL_ERROR=-1
> stmt:szSqlState = "42S21", *pfNativeError = 2727, *pcbErrorMsg = 73,
> *ColumnNumber = -1, *RowNumber = 1
> MessageText = "[Microsoft][SQL Native Client][SQL Server]Cannot find index
> 'index_junk'."
>
> My configuration:
> SQL Server 2005 IDW12 (I believe)
> SQL Native Client dirver that comes with it.
> The same error exist with I use SQL ODBC Driver that comes with MDAC 2.8.
I
> have not tried SQL Server 2000, but I believe this error code mapping
occurs
> in ODBC on the client side and Server should not make a difference.
>
>
> --Aleksey
>
>
>
> "Bei Zhu [MSFT]" wrote:
>
> > Could you please provide more info? Like index_junk and table creation.
> >
> > "Aleksey Dmitriyev" <AlekseyDmitriyev@discussions.microsoft.com> wrote
in
> > message news:981E61BC-DB8B-4DE3-A21A-6FFEE2824DF2@microsoft.com...
> > > I get SQLSTATE 42S21 with native code 2727 when executing this query:
> > >
> > > alter index index_junk on testauto rebuild
> > >
> > > According to ODBC documentation the SQLSTATE should be 42S12 "Index
not
> > > found", not 42S21 "Column already exists". Is it a bug?
> > >
> > > --
> > > -- Aleksey Dmitriyev
> >
> >
> >
Yes, I understand that. The error is expected in this case. However, I expect
different SQLSTATE. If you read my original post again, you can see that I
was expecting 42S12.
--Aleksey
[quoted text, click to view] "Bei Zhu [MSFT]" wrote:
> You need to create index index_junk first, then you can alter it.
>
> "Aleksey Dmitriyev" <AlekseyDmitriyev@discussions.microsoft.com> wrote in
> message news:37C76DB7-59CC-4C63-BBF6-67ED7D9C2F81@microsoft.com...
> > Steps to reproduce:
> >
> > 1) Execute this script using any tool
> > create table t1(a int)
> >
> > 2) Start ODBCTEST and login in to SQL Server. Run this query (I simply
> click
> > on the exclamation point)
> > alter index index_junk on t1 rebuild
> >
> > 3) Review the output:
> > Return: SQL_ERROR=-1
> > stmt:szSqlState = "42S21", *pfNativeError = 2727, *pcbErrorMsg = 73,
> > *ColumnNumber = -1, *RowNumber = 1
> > MessageText = "[Microsoft][SQL Native Client][SQL Server]Cannot find index
> > 'index_junk'."
> >
> > My configuration:
> > SQL Server 2005 IDW12 (I believe)
> > SQL Native Client dirver that comes with it.
> > The same error exist with I use SQL ODBC Driver that comes with MDAC 2.8.
> I
> > have not tried SQL Server 2000, but I believe this error code mapping
> occurs
> > in ODBC on the client side and Server should not make a difference.
> >
> >
> > --Aleksey
> >
> >
> >
> > "Bei Zhu [MSFT]" wrote:
> >
> > > Could you please provide more info? Like index_junk and table creation.
> > >
> > > "Aleksey Dmitriyev" <AlekseyDmitriyev@discussions.microsoft.com> wrote
> in
> > > message news:981E61BC-DB8B-4DE3-A21A-6FFEE2824DF2@microsoft.com...
> > > > I get SQLSTATE 42S21 with native code 2727 when executing this query:
> > > >
> > > > alter index index_junk on testauto rebuild
> > > >
> > > > According to ODBC documentation the SQLSTATE should be 42S12 "Index
> not
> > > > found", not 42S21 "Column already exists". Is it a bug?
> > > >
> > > > --
> > > > -- Aleksey Dmitriyev
> > >
> > >
> > >
>
>
Don't see what you're looking for? Try a search.