Re: Check database status.
- From: "Ken Varn" <nospam>
- Date: Fri, 20 May 2005 08:42:03 -0400
Thanks for the info.
This information is really buried in the SQL Server help. I was able to
find it, but I have a couple other questions.
If I call "'DBCC CHECKDB (tempdb) WITH TABLERESULTS, NO_INFOMSGS", I get no
results back if the DB checks out ok. Is it a safe bet to assume that if I
get no results, then the DB is ok, but if I do get results then the DB could
have errors and be in need of repair?
I am trying to come up with a method for providing the ability for my users
to check the database for errors and report if it is in error.
I also want to use this same call to repair the database if it is broken,
and provide feedback on the success of the repair.
I cannot find any info in the help to show how all of this could be checked
properly with result sets.
--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.
EmailID = varnk
Domain = Diebold.com
-----------------------------------
"Elton W" <EltonW@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:10BF2605-DF2D-4DAC-9C65-F9E8D734BD87@xxxxxxxxxxxxxxxx
> Hi Ken,
>
> In order to get result you should use option WITH TABLERESULTS. For
example
>
> sqlcommand.CommandText = "DBCC CHECKDB (tempdb) WITH TABLERESULTS";
> datareader = sqlcommand..ExecuteReader();
>
> Then you can get result in datareader.
>
> HTH
>
> Elton Wang
> elton_wang@xxxxxxxxxxx
>
>
> "Ken Varn" wrote:
>
> > I want to be able to check an SQLServer database to determine if it is
not damaged or in need of repair. I looked into the DBCC CHECKDB SQL call
to accomplish this. However, I cannot figure out how to check the status of
the database after making this call in ADO.NET. I tried using a
SqlDataReader, but there is nothing returned in the reader that gives me the
status of the call.
> >
> > Can someone make a recommendation on how I can check the status of a
database using ADO.NET?
> >
> >
> > --
> > -----------------------------------
> > Ken Varn
> > Senior Software Engineer
> > Diebold Inc.
> >
> > EmailID = varnk
> > Domain = Diebold.com
> > -----------------------------------
.
- Follow-Ups:
- Re: Check database status.
- From: Elton W
- Re: Check database status.
- References:
- Check database status.
- From: Ken Varn
- RE: Check database status.
- From: Elton W
- Check database status.
- Prev by Date: how to retrieve identity (Any OleDb Provider)
- Next by Date: Re: Login failed for user 'sa'. C#, SqlServer 2000
- Previous by thread: RE: Check database status.
- Next by thread: Re: Check database status.
- Index(es):
Relevant Pages
|