Sunday, March 25, 2012
DBCC ShowFileStatus v. SP_Spaceused
much space is free, DBCC ShowFileStatus and SP_Spaceused give simillar, but
different results. Which is more accurate?
DBCC is accurate. Read the source for sp_spaceused and you will see that it picks up the info from
sysindexes.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"vtcs212" <vtcs212@.discussions.microsoft.com> wrote in message
news:DC3D36A0-E5A6-43AE-94F0-ECE6AC081407@.microsoft.com...
> In trying to determine how much space is begin used by a database and how
> much space is free, DBCC ShowFileStatus and SP_Spaceused give simillar, but
> different results. Which is more accurate?
sql
DBCC ShowFileStatus v. SP_Spaceused
much space is free, DBCC ShowFileStatus and SP_Spaceused give simillar, but
different results. Which is more accurate?DBCC is accurate. Read the source for sp_spaceused and you will see that it picks up the info from
sysindexes.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"vtcs212" <vtcs212@.discussions.microsoft.com> wrote in message
news:DC3D36A0-E5A6-43AE-94F0-ECE6AC081407@.microsoft.com...
> In trying to determine how much space is begin used by a database and how
> much space is free, DBCC ShowFileStatus and SP_Spaceused give simillar, but
> different results. Which is more accurate?
DBCC ShowFileStatus v. SP_Spaceused
much space is free, DBCC ShowFileStatus and SP_Spaceused give simillar, but
different results. Which is more accurate?DBCC is accurate. Read the source for sp_spaceused and you will see that it
picks up the info from
sysindexes.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"vtcs212" <vtcs212@.discussions.microsoft.com> wrote in message
news:DC3D36A0-E5A6-43AE-94F0-ECE6AC081407@.microsoft.com...
> In trying to determine how much space is begin used by a database and how
> much space is free, DBCC ShowFileStatus and SP_Spaceused give simillar, bu
t
> different results. Which is more accurate?
Sunday, February 19, 2012
DBCC CheckDB Question
Is there anyway I can programmatically determine if DBCC CheckDB has found any errors? When I run this command in Management Studio it simply returns a slew of messages. What I would like to do is to create a stored proc that executes this command, somehow determine if any errors were found, and then notify the appropriate person for follow-up. I am at a loss to know how to programmicatically determine if DBCC CheckDB encountered any errors during its run.
Thanks for your help.
A few different things - in the automated routine you are using, you can save the output to a file and search for the errors with a tool like findstr. Or import the file into a table and search for errors in the table. Or create a table that will use DBCC CHECKDB WITH TABLERESULTS, so an insert into that table, along the lines of:
Insert Into YourCheckDBTableResults
Exec ('dbcc checkdb with tableresults')
And then check the table you are storing the results in.
-Sue