Showing posts with label modify. Show all posts
Showing posts with label modify. Show all posts

Wednesday, March 28, 2012

Invalid syntax near nvarchar

Im trying to update and modify data in a grid view in my sql data base. I keep getting this error..What is the solution to this. Sorry, I have no programing experience. All help will be greatly appreciated. thank you
jdslim

Incorrect syntax near 'nvarchar'.

Description:Anunhandled exception occurred during the execution of the current webrequest. Please review the stack trace for more information about theerror and where it originated in the code.

Exception Details:System.Data.SqlClient.SqlException: Incorrect syntax near 'nvarchar'.

Source Error:

An unhandled exception was generated during the execution of thecurrent web request. Information regarding the origin and location ofthe exception can be identified using the exception stack trace below.


Stack Trace:

[SqlException (0x80131904): Incorrect syntax near 'nvarchar'.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +95
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +82
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +346
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +3244
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +186
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +1121
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +334
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +407
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +149
System.Web.UI.WebControls.SqlDataSourceView.ExecuteDbCommand(DbCommand command, DataSourceOperation operation) +493
System.Web.UI.WebControls.SqlDataSourceView.ExecuteUpdate(IDictionary keys, IDictionary values, IDictionary oldValues) +915
System.Web.UI.DataSourceView.Update(IDictionary keys, IDictionary values, IDictionary oldValues, DataSourceViewOperationCallback callback) +179
System.Web.UI.WebControls.GridView.HandleUpdate(GridViewRow row, Int32 rowIndex, Boolean causesValidation) +1140
System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +835
System.Web.UI.WebControls.GridView.OnBubbleEvent(Object source, EventArgs e) +162
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +56
System.Web.UI.WebControls.GridViewRow.OnBubbleEvent(Object source, EventArgs e) +118
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +56
System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +107
System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +175
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +31
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +32
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +244
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3840

It would help if you posted your code.

|||

Here is the new stack trace and the code that goes with it. I started a new page that just contains the gridview and the sql data source.

Stack Trace:

[SqlException (0x80131904): Incorrect syntax near 'nvarchar'.] System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +177 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +68 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +199 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2300 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +147 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +1021 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +314 System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +413 System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +115 System.Web.UI.WebControls.SqlDataSourceView.ExecuteDbCommand(DbCommand command, DataSourceOperation operation) +392 System.Web.UI.WebControls.SqlDataSourceView.ExecuteDelete(IDictionary keys, IDictionary oldValues) +638 System.Web.UI.DataSourceView.Delete(IDictionary keys, IDictionary oldValues, DataSourceViewOperationCallback callback) +71 System.Web.UI.WebControls.GridView.HandleDelete(GridViewRow row, Int32 rowIndex) +933 System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +1152 System.Web.UI.WebControls.GridView.RaisePostBackEvent(String eventArgument) +191 System.Web.UI.WebControls.GridView.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +172 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4919

<%

@.PageLanguage="VB" %>

<!

DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<

scriptrunat="server">

</

script>

<

htmlxmlns="http://www.w3.org/1999/xhtml">

<

headrunat="server"><title>Untitled Page</title>

</

head>

<

body><formid="form1"runat="server"><div> <asp:SqlDataSourceID="SqlDataSource1"runat="server"ConflictDetection="CompareAllValues"ConnectionString="<%$ ConnectionStrings:ConnectionString %>"DeleteCommand="DELETE FROM [Trials] WHERE [Trial#] = @.original_column1 AND [Wet Date] = @.original_Wet_Date AND [Check Date] = @.original_Check_Date AND [Comments] = @.original_Comments"InsertCommand="INSERT INTO [Trials] ([Trial#], [Wet Date], [Check Date], [Comments]) VALUES (@.column1, @.Wet_Date, @.Check_Date, @.Comments)"OldValuesParameterFormatString="original_{0}"SelectCommand="SELECT * FROM [Trials]"UpdateCommand="UPDATE [Trials] SET [Wet Date] = @.Wet_Date, [Check Date] = @.Check_Date, [Comments] = @.Comments WHERE [Trial#] = @.original_column1 AND [Wet Date] = @.original_Wet_Date AND [Check Date] = @.original_Check_Date AND [Comments] = @.original_Comments"><DeleteParameters><asp:ParameterName="original_column1"Type="String"/><asp:ParameterName="original_Wet_Date"Type="DateTime"/><asp:ParameterName="original_Check_Date"Type="DateTime"/><asp:ParameterName="original_Comments"Type="String"/></DeleteParameters><UpdateParameters><asp:ParameterName="Wet_Date"Type="DateTime"/><asp:ParameterName="Check_Date"Type="DateTime"/><asp:ParameterName="Comments"Type="String"/><asp:ParameterName="original_column1"Type="String"/><asp:ParameterName="original_Wet_Date"Type="DateTime"/><asp:ParameterName="original_Check_Date"Type="DateTime"/><asp:ParameterName="original_Comments"Type="String"/></UpdateParameters><InsertParameters><asp:ParameterName="column1"Type="String"/><asp:ParameterName="Wet_Date"Type="DateTime"/><asp:ParameterName="Check_Date"Type="DateTime"/><asp:ParameterName="Comments"Type="String"/></InsertParameters></asp:SqlDataSource></div><asp:GridViewID="GridView1"runat="server"AllowSorting="True"AutoGenerateColumns="False"DataKeyNames="Trial#"DataSourceID="SqlDataSource1"Style="z-index: 100; left: 538px; position: absolute; top: 391px"><Columns><asp:CommandFieldShowDeleteButton="True"ShowEditButton="True"/><asp:BoundFieldDataField="Trial#"HeaderText="Trial#"ReadOnly="True"SortExpression="Trial#"/><asp:BoundFieldDataField="Wet Date"HeaderText="Wet Date"SortExpression="Wet Date"/><asp:BoundFieldDataField="Check Date"HeaderText="Check Date"SortExpression="Check Date"/><asp:BoundFieldDataField="Comments"HeaderText="Comments"SortExpression="Comments"/></Columns></asp:GridView></form>

</

body>

</

html>|||

Hi

I just want to check if you ever solved the problem? I'm sitting with the same thing, but nothing will work...

I've tried the suggestions made, but it still doesn't work.

|||

Hi

I just want to check if you ever solved the problem? I'm sitting with the same thing, but nothing will work...

I've tried the suggestions made, but it still doesn't work.

|||you are better off starting a new thread and post your codes there

Monday, March 19, 2012

Invalid cursor state?

I am trying to make design changes to a SQL table i just created and I keep
getting this error:
'Drug_Alcohol' table
- Unable to modify table.
ODBC error: [Microsoft][ODBC SQL Server Driver]Invalid cursor state
It says in books online that this error can be caused if the sql server runs
out of resources while attempting to save. The database I created is new
and the file size is still only 4megs. I tried increasing the size, but I
still get the error.
Does anyone know what might be happening? The only way I can make changes
to a table now is to recreate a new table with the updated changes and
delete the old one. I am running SQL server 2000 with service pack 3a.Maybe you could show the current structure of the table, sample data, and
the ALTER TABLE statement.
Or, we could guess all day...
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"REB" <russ@.bjorgaard.com> wrote in message
news:#VKtrpR5DHA.504@.TK2MSFTNGP11.phx.gbl...
quote:

> I am trying to make design changes to a SQL table i just created and I

keep
quote:

> getting this error:
> 'Drug_Alcohol' table
> - Unable to modify table.
> ODBC error: [Microsoft][ODBC SQL Server Driver]Invalid cursor state
> It says in books online that this error can be caused if the sql server

runs
quote:

> out of resources while attempting to save. The database I created is new
> and the file size is still only 4megs. I tried increasing the size, but I
> still get the error.
> Does anyone know what might be happening? The only way I can make changes
> to a table now is to recreate a new table with the updated changes and
> delete the old one. I am running SQL server 2000 with service pack 3a.
>
|||The table has 5 columns:
Drug_AlcoholID int 4
DriverID int 4 Allow Nulls
PullDate smalldatetime 4
Pulltype int 4 Allow Nulls
Results char 20 Allow Nulls
I just created the table and there is no data in it.
I get the error if I try to uncheck allow nulls, change the first field to
an identity field, delete a column, or try to add a new column.
I am using Enterprise Manager so I do not see the ALTER TABLE statement.|||Has your local Enterprise Manager (assuming client tools only) been updated
to SP3? Is it even SQL Server 2000? Make sure both client and server are
the same version. Is SQL Server in the correct compatibility mode? You
might have problems changing table properties like that through a 2000 GUI
(which can issue ALTER TABLE calls under the covers) if the underlying
database is actually in 6.5 mode, for example.
Open Query Analyzer, connect to the server, and run:
EXEC sp_dbcmptlevel 'database_name'
This should be in 70 or 80, or else you won't be able to issue many commands
resembling ALTER TABLE.
What operating system are you on locally? What type of authentication are
you using (SQL or Windows)? See http://support.microsoft.com/?id=243292
Also, if you are on a Win9x platform and are using Windows authentication,
you might consider using SQL authentication instead.
Was this database created by upsizing from Access?
Might also see http://support.microsoft.com/?id=821334
Also, most of these operations can and should be handled in Query Analyzer
(ALTER TABLE, EXEC sp_rename, etc). That way you can save your scripts,
check them into source safe, but more meaningful errors when they break,
etc.
Adding the IDENTITY property to an existing column is quite a bit of work...
the database has to make a duplicate table, copy all the rows, drop the old
table, and rename the new one, and keep the table off-limits to all other
processes throughout the task. I suggest if you want IDENTITY you decide so
up front, before the table has data in it...
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"REB" <russ@.bjorgaard.com> wrote in message
news:#76622R5DHA.564@.TK2MSFTNGP10.phx.gbl...
quote:

> The table has 5 columns:
> Drug_AlcoholID int 4
> DriverID int 4 Allow Nulls
> PullDate smalldatetime 4
> Pulltype int 4 Allow Nulls
> Results char 20 Allow Nulls
> I just created the table and there is no data in it.
> I get the error if I try to uncheck allow nulls, change the first field to
> an identity field, delete a column, or try to add a new column.
> I am using Enterprise Manager so I do not see the ALTER TABLE statement.
>
|||Thanks for the response. Using Query analyzer to make the table changes
works just fine (I just had to learn the syntax). Enterprise Manager was
installed with my SQL Server 2000 Standard edition on my test server, which
is running windows server 2003. I have SP3a installed.
Is there a seperate download to update the Enterprise Manager? When I look
under help it says my version of Enterprise Manager is 8.0|||I have been getting the same problem, too. Our scenario:
Server:
Windows Server 2003
SQL 2000 SP3a
MDAC 2.8 with KB832483 hotfix installed
Client 1:
XP Pro SP1a
MDAC 2.8 with KB832483 hotfix installed
Client 2:
XP Home SP1a
MDAC 2.8 (no hotfix installed)
(Also tried Enterprise Manager from server console)
When trying to add column, delete column, or uncheck allow nulls through Ent
erprise Manager, I get the same "Invalid Cursor State" message. This happen
s when performing these operations on any table in any database on the serve
r. However, executing a sc
ript through Query Analyzer to perform these functions causes not problems.
On the XP Pro machine, I have SQL Server 2000 Developer and DO NOT get any o
f these problems.
Regarding the 2003 server, I have verified the following:
Compatibility level of all databases is 80
Connecting to server using SQL or Windows Authentication makes no difference
Connecting using sa or a variety of db admin users makes no difference
No databases were upsized from Access (in fact, all DBs and objects were cre
ated within the last two months from either EM or QA)
My last successful attempt to perform the above operations was Jan 27. The
only configuation change to the server was Jan 29 to install the KB832483 ho
tfix. The next attempt to perform these operations was today and had the pr
oblems indicated above.
I also:
1) Reinstalled MDAC 2.8 on Server, attempted operation from Client 1 and got
error
2) Reinstalled MDAC 2.8 on Client 1, attempted operation from Client 1 and g
ot error
3) Reinstalled KB832483 hotfix on Client 1, attempted operation from Client
1 and got error
4) Reinstalled KB832483 hotfix on Server, attempted operation from Client 1
and got error
This is a development server, so I[m open to trying something radical if nee
ded. Any other suggestions?
John|||What Version of SQL Server do you have? 8.00.760(SP3)?
"JSD" <anonymous@.discussions.microsoft.com> wrote in message
news:815C57B0-77A9-4102-A772-D3849A599DD0@.microsoft.com...
quote:

> I have been getting the same problem, too. Our scenario:
> Server:
> Windows Server 2003
> SQL 2000 SP3a
> MDAC 2.8 with KB832483 hotfix installed
> Client 1:
> XP Pro SP1a
> MDAC 2.8 with KB832483 hotfix installed
> Client 2:
> XP Home SP1a
> MDAC 2.8 (no hotfix installed)
> (Also tried Enterprise Manager from server console)
>
> When trying to add column, delete column, or uncheck allow nulls through

Enterprise Manager, I get the same "Invalid Cursor State" message. This
happens when performing these operations on any table in any database on the
server. However, executing a script through Query Analyzer to perform these
functions causes not problems.
quote:

> On the XP Pro machine, I have SQL Server 2000 Developer and DO NOT get any

of these problems.
quote:

> Regarding the 2003 server, I have verified the following:
> Compatibility level of all databases is 80
> Connecting to server using SQL or Windows Authentication makes no

difference
quote:

> Connecting using sa or a variety of db admin users makes no difference
> No databases were upsized from Access (in fact, all DBs and objects were

created within the last two months from either EM or QA)
quote:

>
> My last successful attempt to perform the above operations was Jan 27.

The only configuation change to the server was Jan 29 to install the
KB832483 hotfix. The next attempt to perform these operations was today and
had the problems indicated above.
quote:

> I also:
> 1) Reinstalled MDAC 2.8 on Server, attempted operation from Client 1 and

got error
quote:

> 2) Reinstalled MDAC 2.8 on Client 1, attempted operation from Client 1 and

got error
quote:

> 3) Reinstalled KB832483 hotfix on Client 1, attempted operation from

Client 1 and got error
quote:

> 4) Reinstalled KB832483 hotfix on Server, attempted operation from Client

1 and got error
quote:

>
> This is a development server, so I[m open to trying something radical if

needed. Any other suggestions?
quote:

> John
|||What is the level of SQL Server on the clients (they should be at the same
SP level as the server)? Why have you not updated client 2 with the MDAC
hotfix?
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"JSD" <anonymous@.discussions.microsoft.com> wrote in message
news:815C57B0-77A9-4102-A772-D3849A599DD0@.microsoft.com...
quote:

> I have been getting the same problem, too. Our scenario:
> Server:
> Windows Server 2003
> SQL 2000 SP3a
> MDAC 2.8 with KB832483 hotfix installed
> Client 1:
> XP Pro SP1a
> MDAC 2.8 with KB832483 hotfix installed
> Client 2:
> XP Home SP1a
> MDAC 2.8 (no hotfix installed)
> (Also tried Enterprise Manager from server console)
>
> When trying to add column, delete column, or uncheck allow nulls through

Enterprise Manager, I get the same "Invalid Cursor State" message. This
happens when performing these operations on any table in any database on the
server. However, executing a script through Query Analyzer to perform these
functions causes not problems.
quote:

> On the XP Pro machine, I have SQL Server 2000 Developer and DO NOT get any

of these problems.
quote:

> Regarding the 2003 server, I have verified the following:
> Compatibility level of all databases is 80
> Connecting to server using SQL or Windows Authentication makes no

difference
quote:

> Connecting using sa or a variety of db admin users makes no difference
> No databases were upsized from Access (in fact, all DBs and objects were

created within the last two months from either EM or QA)
quote:

>
> My last successful attempt to perform the above operations was Jan 27.

The only configuation change to the server was Jan 29 to install the
KB832483 hotfix. The next attempt to perform these operations was today and
had the problems indicated above.
quote:

> I also:
> 1) Reinstalled MDAC 2.8 on Server, attempted operation from Client 1 and

got error
quote:

> 2) Reinstalled MDAC 2.8 on Client 1, attempted operation from Client 1 and

got error
quote:

> 3) Reinstalled KB832483 hotfix on Client 1, attempted operation from

Client 1 and got error
quote:

> 4) Reinstalled KB832483 hotfix on Server, attempted operation from Client

1 and got error
quote:

>
> This is a development server, so I[m open to trying something radical if

needed. Any other suggestions?
quote:

> John
|||SP3 (8.00.859) is installed on the 2003 server, SP3 (8.00.760) on the SQL Se
rver Developer on Client 1. Both Client 1 and Client 2 have SP3a applied to
the client tools, also.
Client 2 belongs to a user who does not regularly keep up with MDAC updates;
therefore, the hotfix was not installed. I wanted to attempt the operation
s on Client 2 to help rule out wheter the hotfix may have caused the problem
on Client 1.
I forgot to mention that we also installed Reporting Services on the 2003 se
rver on the 29th. I e-mailed this question to MS and they didn't think that
installation caused this problem. I can't find a cross-reference to determ
ine how the 2003 server got
8.00.859, so I suspect this is due to installing Reporting Services. I'm do
ubting whether uninstalling Reporting Services would get that server back to
8.00.760.
Any ideas?|||>> I can't find a cross-reference to determine how the 2003 server got
8.00.859, so I suspect this is due to installing Reporting Services.
No, this has nothing to do with RS. 859 is the most recent *publicly*
available hotfix that I'm aware of. See
http://support.microsoft.com/?kbid=821334
You can trace specific version #s here:
http://www.aspfaq.com/2160
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/

Invalid cursor state?

I am trying to make design changes to a SQL table i just created and I keep
getting this error:
'Drug_Alcohol' table
- Unable to modify table.
ODBC error: [Microsoft][ODBC SQL Server Driver]Invalid cursor state
It says in books online that this error can be caused if the sql server runs
out of resources while attempting to save. The database I created is new
and the file size is still only 4megs. I tried increasing the size, but I
still get the error.
Does anyone know what might be happening? The only way I can make changes
to a table now is to recreate a new table with the updated changes and
delete the old one. I am running SQL server 2000 with service pack 3a.Maybe you could show the current structure of the table, sample data, and
the ALTER TABLE statement.
Or, we could guess all day...
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"REB" <russ@.bjorgaard.com> wrote in message
news:#VKtrpR5DHA.504@.TK2MSFTNGP11.phx.gbl...
> I am trying to make design changes to a SQL table i just created and I
keep
> getting this error:
> 'Drug_Alcohol' table
> - Unable to modify table.
> ODBC error: [Microsoft][ODBC SQL Server Driver]Invalid cursor state
> It says in books online that this error can be caused if the sql server
runs
> out of resources while attempting to save. The database I created is new
> and the file size is still only 4megs. I tried increasing the size, but I
> still get the error.
> Does anyone know what might be happening? The only way I can make changes
> to a table now is to recreate a new table with the updated changes and
> delete the old one. I am running SQL server 2000 with service pack 3a.
>|||The table has 5 columns:
Drug_AlcoholID int 4
DriverID int 4 Allow Nulls
PullDate smalldatetime 4
Pulltype int 4 Allow Nulls
Results char 20 Allow Nulls
I just created the table and there is no data in it.
I get the error if I try to uncheck allow nulls, change the first field to
an identity field, delete a column, or try to add a new column.
I am using Enterprise Manager so I do not see the ALTER TABLE statement.|||Has your local Enterprise Manager (assuming client tools only) been updated
to SP3? Is it even SQL Server 2000? Make sure both client and server are
the same version. Is SQL Server in the correct compatibility mode? You
might have problems changing table properties like that through a 2000 GUI
(which can issue ALTER TABLE calls under the covers) if the underlying
database is actually in 6.5 mode, for example.
Open Query Analyzer, connect to the server, and run:
EXEC sp_dbcmptlevel 'database_name'
This should be in 70 or 80, or else you won't be able to issue many commands
resembling ALTER TABLE.
What operating system are you on locally? What type of authentication are
you using (SQL or Windows)? See http://support.microsoft.com/?id=243292
Also, if you are on a Win9x platform and are using Windows authentication,
you might consider using SQL authentication instead.
Was this database created by upsizing from Access?
Might also see http://support.microsoft.com/?id=821334
Also, most of these operations can and should be handled in Query Analyzer
(ALTER TABLE, EXEC sp_rename, etc). That way you can save your scripts,
check them into source safe, but more meaningful errors when they break,
etc.
Adding the IDENTITY property to an existing column is quite a bit of work...
the database has to make a duplicate table, copy all the rows, drop the old
table, and rename the new one, and keep the table off-limits to all other
processes throughout the task. I suggest if you want IDENTITY you decide so
up front, before the table has data in it...
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"REB" <russ@.bjorgaard.com> wrote in message
news:#76622R5DHA.564@.TK2MSFTNGP10.phx.gbl...
> The table has 5 columns:
> Drug_AlcoholID int 4
> DriverID int 4 Allow Nulls
> PullDate smalldatetime 4
> Pulltype int 4 Allow Nulls
> Results char 20 Allow Nulls
> I just created the table and there is no data in it.
> I get the error if I try to uncheck allow nulls, change the first field to
> an identity field, delete a column, or try to add a new column.
> I am using Enterprise Manager so I do not see the ALTER TABLE statement.
>|||Thanks for the response. Using Query analyzer to make the table changes
works just fine (I just had to learn the syntax). Enterprise Manager was
installed with my SQL Server 2000 Standard edition on my test server, which
is running windows server 2003. I have SP3a installed.
Is there a seperate download to update the Enterprise Manager? When I look
under help it says my version of Enterprise Manager is 8.0|||I have been getting the same problem, too. Our scenario
Server
Windows Server 200
SQL 2000 SP3
MDAC 2.8 with KB832483 hotfix installe
Client 1
XP Pro SP1
MDAC 2.8 with KB832483 hotfix installe
Client 2
XP Home SP1
MDAC 2.8 (no hotfix installed
(Also tried Enterprise Manager from server console
When trying to add column, delete column, or uncheck allow nulls through Enterprise Manager, I get the same "Invalid Cursor State" message. This happens when performing these operations on any table in any database on the server. However, executing a script through Query Analyzer to perform these functions causes not problems
On the XP Pro machine, I have SQL Server 2000 Developer and DO NOT get any of these problems
Regarding the 2003 server, I have verified the following
Compatibility level of all databases is 8
Connecting to server using SQL or Windows Authentication makes no differenc
Connecting using sa or a variety of db admin users makes no differenc
No databases were upsized from Access (in fact, all DBs and objects were created within the last two months from either EM or QA
My last successful attempt to perform the above operations was Jan 27. The only configuation change to the server was Jan 29 to install the KB832483 hotfix. The next attempt to perform these operations was today and had the problems indicated above
I also
1) Reinstalled MDAC 2.8 on Server, attempted operation from Client 1 and got erro
2) Reinstalled MDAC 2.8 on Client 1, attempted operation from Client 1 and got erro
3) Reinstalled KB832483 hotfix on Client 1, attempted operation from Client 1 and got erro
4) Reinstalled KB832483 hotfix on Server, attempted operation from Client 1 and got erro
This is a development server, so I[m open to trying something radical if needed. Any other suggestions
John|||What Version of SQL Server do you have? 8.00.760(SP3)?
"JSD" <anonymous@.discussions.microsoft.com> wrote in message
news:815C57B0-77A9-4102-A772-D3849A599DD0@.microsoft.com...
> I have been getting the same problem, too. Our scenario:
> Server:
> Windows Server 2003
> SQL 2000 SP3a
> MDAC 2.8 with KB832483 hotfix installed
> Client 1:
> XP Pro SP1a
> MDAC 2.8 with KB832483 hotfix installed
> Client 2:
> XP Home SP1a
> MDAC 2.8 (no hotfix installed)
> (Also tried Enterprise Manager from server console)
>
> When trying to add column, delete column, or uncheck allow nulls through
Enterprise Manager, I get the same "Invalid Cursor State" message. This
happens when performing these operations on any table in any database on the
server. However, executing a script through Query Analyzer to perform these
functions causes not problems.
> On the XP Pro machine, I have SQL Server 2000 Developer and DO NOT get any
of these problems.
> Regarding the 2003 server, I have verified the following:
> Compatibility level of all databases is 80
> Connecting to server using SQL or Windows Authentication makes no
difference
> Connecting using sa or a variety of db admin users makes no difference
> No databases were upsized from Access (in fact, all DBs and objects were
created within the last two months from either EM or QA)
>
> My last successful attempt to perform the above operations was Jan 27.
The only configuation change to the server was Jan 29 to install the
KB832483 hotfix. The next attempt to perform these operations was today and
had the problems indicated above.
> I also:
> 1) Reinstalled MDAC 2.8 on Server, attempted operation from Client 1 and
got error
> 2) Reinstalled MDAC 2.8 on Client 1, attempted operation from Client 1 and
got error
> 3) Reinstalled KB832483 hotfix on Client 1, attempted operation from
Client 1 and got error
> 4) Reinstalled KB832483 hotfix on Server, attempted operation from Client
1 and got error
>
> This is a development server, so I[m open to trying something radical if
needed. Any other suggestions?
> John|||What is the level of SQL Server on the clients (they should be at the same
SP level as the server)? Why have you not updated client 2 with the MDAC
hotfix?
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"JSD" <anonymous@.discussions.microsoft.com> wrote in message
news:815C57B0-77A9-4102-A772-D3849A599DD0@.microsoft.com...
> I have been getting the same problem, too. Our scenario:
> Server:
> Windows Server 2003
> SQL 2000 SP3a
> MDAC 2.8 with KB832483 hotfix installed
> Client 1:
> XP Pro SP1a
> MDAC 2.8 with KB832483 hotfix installed
> Client 2:
> XP Home SP1a
> MDAC 2.8 (no hotfix installed)
> (Also tried Enterprise Manager from server console)
>
> When trying to add column, delete column, or uncheck allow nulls through
Enterprise Manager, I get the same "Invalid Cursor State" message. This
happens when performing these operations on any table in any database on the
server. However, executing a script through Query Analyzer to perform these
functions causes not problems.
> On the XP Pro machine, I have SQL Server 2000 Developer and DO NOT get any
of these problems.
> Regarding the 2003 server, I have verified the following:
> Compatibility level of all databases is 80
> Connecting to server using SQL or Windows Authentication makes no
difference
> Connecting using sa or a variety of db admin users makes no difference
> No databases were upsized from Access (in fact, all DBs and objects were
created within the last two months from either EM or QA)
>
> My last successful attempt to perform the above operations was Jan 27.
The only configuation change to the server was Jan 29 to install the
KB832483 hotfix. The next attempt to perform these operations was today and
had the problems indicated above.
> I also:
> 1) Reinstalled MDAC 2.8 on Server, attempted operation from Client 1 and
got error
> 2) Reinstalled MDAC 2.8 on Client 1, attempted operation from Client 1 and
got error
> 3) Reinstalled KB832483 hotfix on Client 1, attempted operation from
Client 1 and got error
> 4) Reinstalled KB832483 hotfix on Server, attempted operation from Client
1 and got error
>
> This is a development server, so I[m open to trying something radical if
needed. Any other suggestions?
> John|||SP3 (8.00.859) is installed on the 2003 server, SP3 (8.00.760) on the SQL Server Developer on Client 1. Both Client 1 and Client 2 have SP3a applied to the client tools, also
Client 2 belongs to a user who does not regularly keep up with MDAC updates; therefore, the hotfix was not installed. I wanted to attempt the operations on Client 2 to help rule out wheter the hotfix may have caused the problem on Client 1
I forgot to mention that we also installed Reporting Services on the 2003 server on the 29th. I e-mailed this question to MS and they didn't think that installation caused this problem. I can't find a cross-reference to determine how the 2003 server got 8.00.859, so I suspect this is due to installing Reporting Services. I'm doubting whether uninstalling Reporting Services would get that server back to 8.00.760
Any ideas?|||>> I can't find a cross-reference to determine how the 2003 server got
8.00.859, so I suspect this is due to installing Reporting Services.
No, this has nothing to do with RS. 859 is the most recent *publicly*
available hotfix that I'm aware of. See
http://support.microsoft.com/?kbid=821334
You can trace specific version #s here:
http://www.aspfaq.com/2160
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/|||Thanks for the info. I'll bookmark that page at aspfaq.com for future reference
Any other suggestions on the source of the "invalid cursor state" error?|||No, my post earlier summarized all of the reasons I'm aware of.
How about, instead of using Enterprise Manager to make DDL changes, you use
Query Analyzer?
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"JSD" <anonymous@.discussions.microsoft.com> wrote in message
news:78B9B85C-061F-40C4-96D1-77BCEB249BC0@.microsoft.com...
> Thanks for the info. I'll bookmark that page at aspfaq.com for future
reference.
> Any other suggestions on the source of the "invalid cursor state" error?|||To me, Query Analyzer is an acceptable alternative. The use of this server will involve some users who need to learn the fundamentals of SQL Server. While doing DDL changes in Query Analyzer is no problem for me, the EM GUI sure would make their learning easier
I think we'll end up creating a support incident for this. Any other resources you would suggest I try before taking the plunge? I spent quite a while researching this on the Web myself and this newsgroup was the only place I found any help
Aaron, thanks again for all your assistance!|||I spoke with MS support over the last couple of days. They gave me instructions on how to get hotfix 876. It is not available for public release yet, so you'll need to call them and ask for a "grace incident" so they don't charge you for the support
Anyway, they'll send a link and a password to get your own copy of the fix
I installed the hotfix and it cleared up all the problems that I reported
Good luck!|||Thanks JSD, made a note in http://www.aspfaq.com/2515
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"JSD" <anonymous@.discussions.microsoft.com> wrote in message
news:72E54CEF-E2F2-40F5-9D96-72BF84A04191@.microsoft.com...
> I spoke with MS support over the last couple of days. They gave me
instructions on how to get hotfix 876. It is not available for public
release yet, so you'll need to call them and ask for a "grace incident" so
they don't charge you for the support.
> Anyway, they'll send a link and a password to get your own copy of the
fix.
> I installed the hotfix and it cleared up all the problems that I reported.
> Good luck!|||I am experiencing the same behavior. Any idea when a hotfix will be
available for this issue? If not, can someone please point me toward the
telephone number I need to use for free information on where to get the
hotfix? It is really aggrevating not being able to modify any tables ...
Thank you,
Michael Carr
"Aaron Bertrand [MVP]" <aaron@.TRASHaspfaq.com> wrote in message
news:OG4cuVp7DHA.2168@.TK2MSFTNGP12.phx.gbl...
> Thanks JSD, made a note in http://www.aspfaq.com/2515|||You can ask for fix 878.
http://support.microsoft.com/?kbid=831950
http://support.microsoft.com/?scid=fh;en-us;Prodoffer41a
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"Michael Carr" <mcarr@.umich.edu> wrote in message
news:OtHSTcC$DHA.392@.TK2MSFTNGP12.phx.gbl...
> I am experiencing the same behavior. Any idea when a hotfix will be
> available for this issue? If not, can someone please point me toward the
> telephone number I need to use for free information on where to get the
> hotfix? It is really aggrevating not being able to modify any tables ...
> Thank you,
> Michael Carr
> "Aaron Bertrand [MVP]" <aaron@.TRASHaspfaq.com> wrote in message
> news:OG4cuVp7DHA.2168@.TK2MSFTNGP12.phx.gbl...
> > Thanks JSD, made a note in http://www.aspfaq.com/2515
>|||Hey thanks, that fixed it right up!
Michael Carr
"Aaron Bertrand [MVP]" <aaron@.TRASHaspfaq.com> wrote in message
news:#8zODhH$DHA.2592@.TK2MSFTNGP10.phx.gbl...
> You can ask for fix 878.
> http://support.microsoft.com/?kbid=831950
> http://support.microsoft.com/?scid=fh;en-us;Prodoffer41a

Invalid Cursor State

After I create a table, if I attempt to modify or insert a column using the
wizard in EM, I get the following error:
-Unable to modify table.
ODBC error: [Microsoft][ODBC SQL Server Driver]Invalid Cursor State
I have SP3a installed, Analysis Services and SQL Reporting. Any suggestions?
Thanks.
DanSounds like this KB article.
FIX: An invalid cursor state occurs after you apply Hotfix 8.00.0859 or
later in SQL Server 2000
http://support.microsoft.com/kb/831997
However, this MS PSS only fix looks like BUILD 876. BUILD 878 is public and
located here:
http://support.microsoft.com/?kbid=838166
Since these are cumulative, it would include the fix for the other.
Sincerely,
Anthony Thomas
"DLS" <DLS@.discussions.microsoft.com> wrote in message
news:2BB9D7A0-6BCE-426F-9375-7D205280F4DA@.microsoft.com...
After I create a table, if I attempt to modify or insert a column using the
wizard in EM, I get the following error:
-Unable to modify table.
ODBC error: [Microsoft][ODBC SQL Server Driver]Invalid Cursor State
I have SP3a installed, Analysis Services and SQL Reporting. Any suggestions?
Thanks.
Dan

Invalid Cursor State

After I create a table, if I attempt to modify or insert a column using the
wizard in EM, I get the following error:
-Unable to modify table.
ODBC error: [Microsoft][ODBC SQL Server Driver]Invalid Cursor State
I have SP3a installed, Analysis Services and SQL Reporting. Any suggestions?
Thanks.
DanSounds like this KB article.
FIX: An invalid cursor state occurs after you apply Hotfix 8.00.0859 or
later in SQL Server 2000
http://support.microsoft.com/kb/831997
However, this MS PSS only fix looks like BUILD 876. BUILD 878 is public and
located here:
http://support.microsoft.com/?kbid=838166
Since these are cumulative, it would include the fix for the other.
Sincerely,
Anthony Thomas
--
"DLS" <DLS@.discussions.microsoft.com> wrote in message
news:2BB9D7A0-6BCE-426F-9375-7D205280F4DA@.microsoft.com...
After I create a table, if I attempt to modify or insert a column using the
wizard in EM, I get the following error:
-Unable to modify table.
ODBC error: [Microsoft][ODBC SQL Server Driver]Invalid Cursor State
I have SP3a installed, Analysis Services and SQL Reporting. Any suggestions?
Thanks.
Dan

Monday, March 12, 2012

Invalid Cursor State

After I create a table, if I attempt to modify or insert a column using the
wizard in EM, I get the following error:
-Unable to modify table.
ODBC error: [Microsoft][ODBC SQL Server Driver]Invalid Cursor State
I have SP3a installed, Analysis Services and SQL Reporting. Any suggestions?
Thanks.
Dan
Sounds like this KB article.
FIX: An invalid cursor state occurs after you apply Hotfix 8.00.0859 or
later in SQL Server 2000
http://support.microsoft.com/kb/831997
However, this MS PSS only fix looks like BUILD 876. BUILD 878 is public and
located here:
http://support.microsoft.com/?kbid=838166
Since these are cumulative, it would include the fix for the other.
Sincerely,
Anthony Thomas
"DLS" <DLS@.discussions.microsoft.com> wrote in message
news:2BB9D7A0-6BCE-426F-9375-7D205280F4DA@.microsoft.com...
After I create a table, if I attempt to modify or insert a column using the
wizard in EM, I get the following error:
-Unable to modify table.
ODBC error: [Microsoft][ODBC SQL Server Driver]Invalid Cursor State
I have SP3a installed, Analysis Services and SQL Reporting. Any suggestions?
Thanks.
Dan