Re: obtaining return values from DBCC INDEXDEFRAG in a sp

From: Dan (dan.parker_at__nospam_pro-bel.com)
Date: 10/07/04


Date: Thu, 7 Oct 2004 10:59:12 +0100

Hi Paul,

I want to put them into a "User Friendly" report, that basically lists the
time, index defragged and the pages scanned, moved, etc.

Regards

Dan

"Paul S Randal [MS]" <prandal@online.microsoft.com> wrote in message
news:%23GZ7H38qEHA.708@tk2msftngp13.phx.gbl...
> You can't do that as the insert/exec creates a user transaction and
> INDEXDEFRAG cannot run inside a user transaction. There's no way to
> capture
> the results from INDEXDEFRAG except using an external text file.
>
> Dan - what do you want to do with the values, out of interest?
>
> Regards
>
> --
> Paul Randal
> Dev Lead, Microsoft SQL Server Storage Engine
>
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
> "Tibor Karaszi" <tibor_please.no.email_karaszi@hotmail.nomail.com> wrote
> in
> message news:uZVSYG5qEHA.2732@TK2MSFTNGP09.phx.gbl...
>> Create a table with the same structure as the DBCC returns and then use
> below technique:
>>
>> INSERT theTable
>> EXEC('DBCC...')
>>
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>>
>>
>> "Dan" <dan.parker@_nospam_pro-bel.com> wrote in message
>> news:uJ2XdA5qEHA.4044@TK2MSFTNGP09.phx.gbl...
>> > Hi All,
>> >
>> > I am writing a stored procedure that performs a DBCC INDEXDEFRAG on a
> number of indexes.
>> >
>> > I wish to then manipulate the values from the result set (Pages
>> > Scanned,
> Pages Moved, Pages
>> > Removed). However I cannot seem to find a way to do this
>> >
>> > Can anyone help please?
>> >
>> > Thanks in advance
>> >
>> > Dan
>> >
>>
>>
>
>



Relevant Pages

  • Re: Difficult qualified name problem
    ... > Hi Chris, ... >> What version of SQL Server are you using? ...
    (microsoft.public.sqlserver.security)
  • Re: System Administrator Implied Permissions
    ... >> Hi Dan, ... >> Now, given this, why does SQL Server ... However, these logins were not ... Other sysadmin role members have the ...
    (microsoft.public.sqlserver.security)
  • Re: System Administrator Implied Permissions
    ... member of the dbo group and you are automatically given ... Now, given this, why does SQL Server ... Much Thanks Dan. ...
    (microsoft.public.sqlserver.security)
  • Re: moving data in a database to another file on a SAN
    ... Moving SQL Server Databases ... > Issues When a Database Is Moved Between SQL Servers ... > "Dan D." ...
    (microsoft.public.sqlserver.server)
  • Re: database owner
    ... Thanks for all your help Dan, ... it can access the SQL Server as a sysadmin role member by default. ... And I don't have to make an own login for the backupexec account on the database, as long as it is a member of the dedicated admins group I made on the database that are a part of the system administrator role? ... I do not have a dedicated login for this user on the server, but this account is member of a administrators group in the sql server and this group is dedicated at dbo on all databases and belongs to the sysadmin servers role. ...
    (microsoft.public.sqlserver.security)