Re: "Invalid Cursor Error"

From: Michael Gaillez (michael.gaillez_at_howest.be)
Date: 05/10/04


Date: Mon, 10 May 2004 22:37:47 +0200


"Egbert Nierop (MVP for IIS)" <egbert_nierop@nospam.invalid> wrote in
message news:#BisWlsNEHA.1276@TK2MSFTNGP11.phx.gbl...
> "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.
>

Well they were nice and are going to send me the patch. I was a bit
frustrated but if they send me the fix, my problems should be over :). But a
few nightly hours searching can drive you mad every now and then; :-D

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

Just plain simple Enterprise Manager. I tried to work around it with the web
data administrator but that didn't work either.

> 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...
>

Yep that's what I figured out as well. Enterprise Manager generates some
extra statements to support that I've read somewhere.

> 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...
>

I will check that...

> 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
>

I will try that as well. It's always usefull to have such workarounds.

Tnx a lot 4 your time.

yours sincerly

Michael



Relevant Pages

  • Re: #OT# Spondulicks about to go back on the banks books as capital
    ... for Time is the greatest innovator: ... and wisdom and counsel shall not alter them to the better, ... when World War II broke out. ... Basically the US FRB issues money against ...
    (alt.machines.cnc)
  • Re: Gazing from the window......
    ... What would everyone else add, alter, take away, assuming money was ... warm golden globe in a permanent blue sky ... You said money no object. ... Reunion Bournemouth August/September 2007 FULL. ...
    (uk.rec.gardening)
  • Re: ALTER IDENTITY setting...
    ... Enterprise Manager would do. ... I also would suggest you use EM and save the script. ... Pro SQL Server 2000 Database Design - ... > I just need to alter column with Identity. ...
    (microsoft.public.sqlserver.programming)
  • Re: how to alter an image column to accept NULL
    ... copy everything into (which is exactly what Enterprise Manager does btw), ... ALTER TABLE MyTable ADD MyNewColumn image NULL ... UPDATE MyTable SET MyNewColumn = MyColumn ... ALTER TABLE MyTable DROP COLUMN MyColumn ...
    (microsoft.public.sqlserver.programming)
  • Computed column in the result of a table-valued UDF
    ... CREATE FUNCTION Test() ... After creating it, when I look at it's code in Enterprise Manager, the ... removing the extra line), I get an error, of course: ... If I try to alter this function (with Enterprise Manager or directly ...
    (microsoft.public.sqlserver.programming)