Re: "Invalid Cursor Error"

From: Egbert Nierop \(MVP for IIS\) (egbert_nierop_at_nospam.invalid)
Date: 05/10/04


Date: Mon, 10 May 2004 21:58:22 +0200


"Michael Gaillez" <michael.gaillez@howest.be> wrote in message
news:%23Xuj6WnNEHA.1348@TK2MSFTNGP12.phx.gbl...
> Dear,
>
> Does anyone have a clue when Microsoft is going to release it's next
service
> pack for SQL-Server? I'm running build 859 at this moment and I can't
alter
> any table anymore in my enterprise manager. ALTER TABLE is fine as long as
> you don't wish to change a column into an identity column. I do not intend
> to spend money on this by calling the support line, since I know what the
> problem is and spending money on this seems absurd. There is no kb article

1) If they can't fix that problem, you dont have to spend money, they'll pay
that back.

2) What's your code? Do you use ADO or something like that?

I can tell you that *no* alter table /alter column statement supports that
natively..
---does *not* work
ALTER TABLE table1 ALTER COLUMN nid ADD IDENTITY (1, 1)

Therefore, I think that the 'cursor error' is raised because some
object/component that you use, did not test this possibility and now it bugs
out...

3) Having the latest ODBC / oledb drivers might help.
Mine is 3.525.1022.0 (odbc32.dll) 2000.85.1022.0(sqloledb.dll) and so on...

4)
this below works...

BEGIN TRANSACTION
SET QUOTED_IDENTIFIER ON
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
SET ARITHABORT ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
COMMIT
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_Table1
 (
 nID int NOT NULL IDENTITY (1, 1),
 adfs char(10) NULL
 ) ON [PRIMARY]
GO
SET IDENTITY_INSERT dbo.Tmp_Table1 ON
GO
IF EXISTS(SELECT * FROM dbo.Table1)
  EXEC('INSERT INTO dbo.Tmp_Table1 (nID, adfs)
  SELECT nID, adfs FROM dbo.Table1 TABLOCKX')
GO
SET IDENTITY_INSERT dbo.Tmp_Table1 OFF
GO
DROP TABLE dbo.Table1
GO
EXECUTE sp_rename N'dbo.Tmp_Table1', N'Table1', 'OBJECT'
GO
ALTER TABLE dbo.Table1 ADD CONSTRAINT
 PK_Table1 PRIMARY KEY CLUSTERED
 (
 nID
 ) ON [PRIMARY]

GO
COMMIT

> for that error as well(although it's is fixed in higher builds than 859)
so
> there is a big chance they don't want to give me a higher build because of
> that (at least that is what appears from other articles). Anyone who can
> help me? My development time reduces drastically and reinstalling isn't an
> option!
>
> yours sincerly
>
> Michael
>
>