Showing posts with label attempt. Show all posts
Showing posts with label attempt. Show all posts

Friday, March 16, 2012

"System.InvalidOperationException: Invalid attempt to MetaData when reader is closed"

I am getting this exception sporadically in a certain block of code (it usually works):

"System.InvalidOperationException: Invalid attempt to MetaData when reader is closed"

The code is below: cmd.CommandText ="[dbo].CountryGetList"; cmd.CommandType = CommandType.StoredProcedure; IDataReader rdr = cmd.ExecuteReader(); List countries =new List(); ...while (rdr.Read()) {//do stuff                  

CountryID = (

Guid)rdr["CountryID"];

//blows up on the next line

cty.Name = (string)rdr["Name"];

}

} rdr.Close();

Any ideas!?

I guess thecmd.Connection has been closed before you finish reading data from IDataReader rdr

Thursday, February 9, 2012

"Attempt to repair any minor problems." What is the point?

What is the point of having this checkbox on the Database Mainenance Plan
properties (Integrity tab) window?
For the plan to fix minor problems, it requires the db to be in Single User
Mode.
"[Microsoft][ODBC SQL Server Driver][SQL Server]Repair statement not
processed. Database needs to be in single user mode."
For the plan to execute it requires SQLAgent to be running.
For SqlAgent to be running, it requires NOT Single User Mode.
The message indicates that the *database* needs to be in single-user mode.
This should not be confused with the *server* being in single-user mode.
Personally, I prefer to fix errors manually rather than do this in a
maintenance plan.
Hope this helps.
Dan Guzman
SQL Server MVP
"Travis" <travis@.c*Y*C*l*Eutah.com> wrote in message
news:%23GMp%238tMEHA.1608@.TK2MSFTNGP12.phx.gbl...
> What is the point of having this checkbox on the Database Mainenance Plan
> properties (Integrity tab) window?
>
> For the plan to fix minor problems, it requires the db to be in Single
User
> Mode.
> "[Microsoft][ODBC SQL Server Driver][SQL Server]Repair statement not
> processed. Database needs to be in single user mode."
> For the plan to execute it requires SQLAgent to be running.
> For SqlAgent to be running, it requires NOT Single User Mode.
>
>

"Attempt to repair any minor problems." What is the point?

I have done a maintenance plan and I have this error:
Microsoft (R) SQLMaint Utility (Unicode), Version Logged=20
on to SQL Server 'Cluster instance' as 'User' (trusted)
Starting maintenance plan 'DB Maintenance Plan5' on=20
31/05/2004 18:59:00
[1] Database xxxxxx: Index Rebuild (leaving 10%% free=20
space)...
Rebuilding indexes for table 'AccessStatusMap'
......................
Rebuilding indexes for table 'TransactionPropertyMap'
[Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 3628:=20
[Microsoft][ODBC SQL Server Driver][SQL Server]A floating=20
point exception occurred in the user process. Current=20
transaction is canceled.
[Microsoft][ODBC SQL Server Driver][SQL Server]DBCC=20
execution completed. If DBCC printed error messages,=20
contact your system administrator.
=BFDo Anybody know, why is it the cause of this error?
Sincerely,
Ignacio
=20
>--Original Message--
>What is the point of having this checkbox on the Database=20
Mainenance Plan
>properties (Integrity tab) window?
>
>For the plan to fix minor problems, it requires the db to=20
be in Single User
>Mode.
>"[Microsoft][ODBC SQL Server Driver][SQL Server]Repair=20
statement not
>processed. Database needs to be in single user mode."
>For the plan to execute it requires SQLAgent to be=20
running.
>For SqlAgent to be running, it requires NOT Single User=20
Mode.
>
>.
>
My guess is you have some invalid float data in the table/index. Turn on
trace flag 2570 and run DBCC CHECKTABLE on the table in question. 2570
switches on some extra data range value checking of things like floats and
dates. FYI: this functionality is controlled by documented T-SQL in SQL
Server 2005 rather than a trace flag.
Regards.
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"Ignacio" <anonymous@.discussions.microsoft.com> wrote in message
news:1bfe01c44737$1dc83550$3501280a@.phx.gbl...
I have done a maintenance plan and I have this error:
Microsoft (R) SQLMaint Utility (Unicode), Version Logged
on to SQL Server 'Cluster instance' as 'User' (trusted)
Starting maintenance plan 'DB Maintenance Plan5' on
31/05/2004 18:59:00
[1] Database xxxxxx: Index Rebuild (leaving 10%% free
space)...
Rebuilding indexes for table 'AccessStatusMap'
......................
Rebuilding indexes for table 'TransactionPropertyMap'
[Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 3628:
[Microsoft][ODBC SQL Server Driver][SQL Server]A floating
point exception occurred in the user process. Current
transaction is canceled.
[Microsoft][ODBC SQL Server Driver][SQL Server]DBCC
execution completed. If DBCC printed error messages,
contact your system administrator.
Do Anybody know, why is it the cause of this error?
Sincerely,
Ignacio

>--Original Message--
>What is the point of having this checkbox on the Database
Mainenance Plan
>properties (Integrity tab) window?
>
>For the plan to fix minor problems, it requires the db to
be in Single User
>Mode.
>"[Microsoft][ODBC SQL Server Driver][SQL Server]Repair
statement not
>processed. Database needs to be in single user mode."
>For the plan to execute it requires SQLAgent to be
running.
>For SqlAgent to be running, it requires NOT Single User
Mode.
>
>.
>

"Attempt to repair any minor problems." What is the point?

I have done a maintenance plan and I have this error:
Microsoft (R) SQLMaint Utility (Unicode), Version Logged=20
on to SQL Server 'Cluster instance' as 'User' (trusted)
Starting maintenance plan 'DB Maintenance Plan5' on=20
31/05/2004 18:59:00
[1] Database xxxxxx: Index Rebuild (leaving 10%% free=20
space)...
Rebuilding indexes for table 'AccessStatusMap'
.....................
Rebuilding indexes for table 'TransactionPropertyMap'
[Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 3628:=20
[Microsoft][ODBC SQL Server Driver][SQL Server]A floating=20
point exception occurred in the user process. Current=20
transaction is canceled.
[Microsoft][ODBC SQL Server Driver][SQL Server]DBCC=20
execution completed. If DBCC printed error messages,=20
contact your system administrator.
=BFDo Anybody know, why is it the cause of this error?
Sincerely,
Ignacio
=20
>--Original Message--
>What is the point of having this checkbox on the Database=20
Mainenance Plan
>properties (Integrity tab) window?
>
>For the plan to fix minor problems, it requires the db to=20
be in Single User
>Mode.
>"[Microsoft][ODBC SQL Server Driver][SQL Server]Repair=20
statement not
>processed. Database needs to be in single user mode."
>For the plan to execute it requires SQLAgent to be=20
running.
>For SqlAgent to be running, it requires NOT Single User=20
Mode.
>
>.
>My guess is you have some invalid float data in the table/index. Turn on
trace flag 2570 and run DBCC CHECKTABLE on the table in question. 2570
switches on some extra data range value checking of things like floats and
dates. FYI: this functionality is controlled by documented T-SQL in SQL
Server 2005 rather than a trace flag.
Regards.
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"Ignacio" <anonymous@.discussions.microsoft.com> wrote in message
news:1bfe01c44737$1dc83550$3501280a@.phx.gbl...
I have done a maintenance plan and I have this error:
Microsoft (R) SQLMaint Utility (Unicode), Version Logged
on to SQL Server 'Cluster instance' as 'User' (trusted)
Starting maintenance plan 'DB Maintenance Plan5' on
31/05/2004 18:59:00
[1] Database xxxxxx: Index Rebuild (leaving 10%% free
space)...
Rebuilding indexes for table 'AccessStatusMap'
.....................
Rebuilding indexes for table 'TransactionPropertyMap'
[Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 3628:
[Microsoft][ODBC SQL Server Driver][SQL Server]A floating
point exception occurred in the user process. Current
transaction is canceled.
[Microsoft][ODBC SQL Server Driver][SQL Server]DBCC
execution completed. If DBCC printed error messages,
contact your system administrator.
Do Anybody know, why is it the cause of this error?
Sincerely,
Ignacio

>--Original Message--
>What is the point of having this checkbox on the Database
Mainenance Plan
>properties (Integrity tab) window?
>
>For the plan to fix minor problems, it requires the db to
be in Single User
>Mode.
>"[Microsoft][ODBC SQL Server Driver][SQL Server]Repair
statement not
>processed. Database needs to be in single user mode."
>For the plan to execute it requires SQLAgent to be
running.
>For SqlAgent to be running, it requires NOT Single User
Mode.
>
>.
>

"Attempt to repair any minor problems." What is the point?

What is the point of having this checkbox on the Database Mainenance Plan
properties (Integrity tab) window?
For the plan to fix minor problems, it requires the db to be in Single User
Mode.
"[Microsoft][ODBC SQL Server Driver][SQL Server]Repair statement
not
processed. Database needs to be in single user mode."
For the plan to execute it requires SQLAgent to be running.
For SqlAgent to be running, it requires NOT Single User Mode.The message indicates that the *database* needs to be in single-user mode.
This should not be confused with the *server* being in single-user mode.
Personally, I prefer to fix errors manually rather than do this in a
maintenance plan.
Hope this helps.
Dan Guzman
SQL Server MVP
"Travis" <travis@.c*Y*C*l*Eutah.com> wrote in message
news:%23GMp%238tMEHA.1608@.TK2MSFTNGP12.phx.gbl...
> What is the point of having this checkbox on the Database Mainenance Plan
> properties (Integrity tab) window?
>
> For the plan to fix minor problems, it requires the db to be in Single
User
> Mode.
> "[Microsoft][ODBC SQL Server Driver][SQL Server]Repair stateme
nt not
> processed. Database needs to be in single user mode."
> For the plan to execute it requires SQLAgent to be running.
> For SqlAgent to be running, it requires NOT Single User Mode.
>
>

Friday, January 27, 2012

"Attempt to repair any minor problems." What is the point?

What is the point of having this checkbox on the Database Mainenance Plan
properties (Integrity tab) window?
For the plan to fix minor problems, it requires the db to be in Single User
Mode.
"[Microsoft][ODBC SQL Server Driver][SQL Server]Repair statement not
processed. Database needs to be in single user mode."
For the plan to execute it requires SQLAgent to be running.
For SqlAgent to be running, it requires NOT Single User Mode.The message indicates that the *database* needs to be in single-user mode.
This should not be confused with the *server* being in single-user mode.
Personally, I prefer to fix errors manually rather than do this in a
maintenance plan.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Travis" <travis@.c*Y*C*l*Eutah.com> wrote in message
news:%23GMp%238tMEHA.1608@.TK2MSFTNGP12.phx.gbl...
> What is the point of having this checkbox on the Database Mainenance Plan
> properties (Integrity tab) window?
>
> For the plan to fix minor problems, it requires the db to be in Single
User
> Mode.
> "[Microsoft][ODBC SQL Server Driver][SQL Server]Repair statement not
> processed. Database needs to be in single user mode."
> For the plan to execute it requires SQLAgent to be running.
> For SqlAgent to be running, it requires NOT Single User Mode.
>
>|||I have done a maintenance plan and I have this error:
Microsoft (R) SQLMaint Utility (Unicode), Version Logged on to SQL Server 'Cluster instance' as 'User' (trusted)
Starting maintenance plan 'DB Maintenance Plan5' on 31/05/2004 18:59:00
[1] Database xxxxxx: Index Rebuild (leaving 10%% free space)...
Rebuilding indexes for table 'AccessStatusMap'
......................
Rebuilding indexes for table 'TransactionPropertyMap'
[Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 3628: [Microsoft][ODBC SQL Server Driver][SQL Server]A floating point exception occurred in the user process. Current transaction is canceled.
[Microsoft][ODBC SQL Server Driver][SQL Server]DBCC execution completed. If DBCC printed error messages, contact your system administrator.
=BFDo Anybody know, why is it the cause of this error?
Sincerely,
Ignacio
>--Original Message--
>What is the point of having this checkbox on the Database Mainenance Plan
>properties (Integrity tab) window?
>
>For the plan to fix minor problems, it requires the db to be in Single User
>Mode.
>"[Microsoft][ODBC SQL Server Driver][SQL Server]Repair statement not
>processed. Database needs to be in single user mode."
>For the plan to execute it requires SQLAgent to be running.
>For SqlAgent to be running, it requires NOT Single User Mode.
>
>.
>|||My guess is you have some invalid float data in the table/index. Turn on
trace flag 2570 and run DBCC CHECKTABLE on the table in question. 2570
switches on some extra data range value checking of things like floats and
dates. FYI: this functionality is controlled by documented T-SQL in SQL
Server 2005 rather than a trace flag.
Regards.
--
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"Ignacio" <anonymous@.discussions.microsoft.com> wrote in message
news:1bfe01c44737$1dc83550$3501280a@.phx.gbl...
I have done a maintenance plan and I have this error:
Microsoft (R) SQLMaint Utility (Unicode), Version Logged
on to SQL Server 'Cluster instance' as 'User' (trusted)
Starting maintenance plan 'DB Maintenance Plan5' on
31/05/2004 18:59:00
[1] Database xxxxxx: Index Rebuild (leaving 10%% free
space)...
Rebuilding indexes for table 'AccessStatusMap'
......................
Rebuilding indexes for table 'TransactionPropertyMap'
[Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 3628:
[Microsoft][ODBC SQL Server Driver][SQL Server]A floating
point exception occurred in the user process. Current
transaction is canceled.
[Microsoft][ODBC SQL Server Driver][SQL Server]DBCC
execution completed. If DBCC printed error messages,
contact your system administrator.
¿Do Anybody know, why is it the cause of this error?
Sincerely,
Ignacio
>--Original Message--
>What is the point of having this checkbox on the Database
Mainenance Plan
>properties (Integrity tab) window?
>
>For the plan to fix minor problems, it requires the db to
be in Single User
>Mode.
>"[Microsoft][ODBC SQL Server Driver][SQL Server]Repair
statement not
>processed. Database needs to be in single user mode."
>For the plan to execute it requires SQLAgent to be
running.
>For SqlAgent to be running, it requires NOT Single User
Mode.
>
>.
>

Something seriously wrong

We have one database that is actually quite small, about 1.8GB. Upon moving
this db to SQL2K5 we get an error everytime we attempt to view the "Views"
folder. The error is:
Value cannot be null.
Parameter name: context (ObjectExplorer)
No more detail is available. I've gone back to the source database, removed
all views and repeated the process. Even with no views in the database we
get the same error when clicking on the "Views" folder in SQL Managment
Studio. All other db's have migrated fine.
NOW I figured I'd use the compare utility we have (We use Red Gates SQL
Compare) to compare the schema from that database to another server with an
old copy. This worked a few weeks ago, now it gives the error "Specified
cast is invalid" which sounds very likely to be related. This happens on
all servers running a copy of this database regardless of SQL Server
version. So at some point something bad was introduced. I'm just not sure
where to look, it sounds metadata related possibly but I'd hope there's some
other way of determining this other than going to a 6 week old backup and
hoping the issue isn't there.
Any help is greeted with humble thanks...we're really stuck.Tim,
Did you run the Upgrade Advisor on the DB before the move to 2005? This
might tell you something that does not migrate.
Chris Wood
"Tim Greenwood" <tim_greenwood A-T yahoo D-O-T com> wrote in message
news:uLgna8WaGHA.504@.TK2MSFTNGP03.phx.gbl...
> We have one database that is actually quite small, about 1.8GB. Upon
> moving this db to SQL2K5 we get an error everytime we attempt to view the
> "Views" folder. The error is:
> Value cannot be null.
> Parameter name: context (ObjectExplorer)
> No more detail is available. I've gone back to the source database,
> removed all views and repeated the process. Even with no views in the
> database we get the same error when clicking on the "Views" folder in SQL
> Managment Studio. All other db's have migrated fine.
> NOW I figured I'd use the compare utility we have (We use Red Gates SQL
> Compare) to compare the schema from that database to another server with
> an old copy. This worked a few weeks ago, now it gives the error
> "Specified cast is invalid" which sounds very likely to be related. This
> happens on all servers running a copy of this database regardless of SQL
> Server version. So at some point something bad was introduced. I'm just
> not sure where to look, it sounds metadata related possibly but I'd hope
> there's some other way of determining this other than going to a 6 week
> old backup and hoping the issue isn't there.
> Any help is greeted with humble thanks...we're really stuck.
>|||Yes I did. It only flagged a couple of sprocs with a syntax change (using
aliases in the order by clause)....
I might not have been clear. We encountered the issue during migration, BUT
then going back to our SQL 2000 servers currently in production this error
was encountered when using a specific tool. So, the issue is present BEFORE
migration.
"Chris Wood" <anonymous@.discussions.microsoft.com> wrote in message
news:eZTYegXaGHA.5004@.TK2MSFTNGP02.phx.gbl...
> Tim,
> Did you run the Upgrade Advisor on the DB before the move to 2005? This
> might tell you something that does not migrate.
> Chris Wood
> "Tim Greenwood" <tim_greenwood A-T yahoo D-O-T com> wrote in message
> news:uLgna8WaGHA.504@.TK2MSFTNGP03.phx.gbl...
>> We have one database that is actually quite small, about 1.8GB. Upon
>> moving this db to SQL2K5 we get an error everytime we attempt to view the
>> "Views" folder. The error is:
>> Value cannot be null.
>> Parameter name: context (ObjectExplorer)
>> No more detail is available. I've gone back to the source database,
>> removed all views and repeated the process. Even with no views in the
>> database we get the same error when clicking on the "Views" folder in SQL
>> Managment Studio. All other db's have migrated fine.
>> NOW I figured I'd use the compare utility we have (We use Red Gates SQL
>> Compare) to compare the schema from that database to another server with
>> an old copy. This worked a few weeks ago, now it gives the error
>> "Specified cast is invalid" which sounds very likely to be related. This
>> happens on all servers running a copy of this database regardless of SQL
>> Server version. So at some point something bad was introduced. I'm just
>> not sure where to look, it sounds metadata related possibly but I'd hope
>> there's some other way of determining this other than going to a 6 week
>> old backup and hoping the issue isn't there.
>> Any help is greeted with humble thanks...we're really stuck.
>

Reporting Services Error !

I have installed SQL Server Reporting Services and I recieve the following error when I attempt to call the reportserver from the URL.

"Server Application Unavailable
The web application you are attempting to access on this web server is currently unavailable. Please hit the 'Refresh' button in your web browser to retry your request.

Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur. "

In the event log, the following error is recorded..."

"aspnet_wp.exe could not be started. The error code for the failure is 80004005. This error can be caused when the worker process account has insufficient rights to read the .NET Framework files. Please ensure that the .NET Framework is correctly installed and that the ACLs on the installation directory allow access to the configured account. "

I have ran "aspnet_regiis -i" after installing reporting services...
I have validated that ASPNET has the correct permissions...
I have validated that ASPNET user account has not been lockedout...
I have restarted the Report Server service...
I have restarted the IIS service...
I even have restarted the server...

Does anyone have any other ideas that may help! Thank you in advance.Try this url it is permissions related. Hope this helps.

http://support.microsoft.com/default.aspx?scid=kb;en-us;315158

Kind regards,
Gift Peddie|||My server is not a domain controller. The instructions on the link that you provided addresses the issue if it is a domain controller.

I did check my machine.config file and the <processModel> contains:

userName="machine"
password="AutoGenerate"

Why wouldn't this work for a non-domain controller server?|||Also, by the way, I have installed the .Net 1.1 hot fix|||I am sorry I did not ask you if you installed the Reporting Services and SQL Server with Service accounts because when SQL Server is installed in a Networked box is it good practice to use Service accounts so you will not get all the permissions related errors. Hope this helps.

Kind regards,
Gift Peddie|||I am using the domain service account. Would I need to change the machine.config file to different settings other than below?

userName="machine"
password="AutoGenerate"

Also, when I attempt to run rsactivate, I recieve the following error:
Failure parsing the config file.
Invalid URI: The host name could not be parsed.

The config file that it is referring to is the rsreportserver.config.|||Reporting Service applications are run through IIS so the username should be the Asp.net worker process account which is different from the service account used to install Reproting Service. You may also need to give Asp.net account full permissions to the Reporting application root folder. Hope this helps.

Kind regards,
Gift Peddie