Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 storedproc result in calling storedproc variable

Author  Topic 

tiaa_ns
Starting Member

16 Posts

Posted - 2001-08-23 : 15:38:18
I'm calling a stotred proc from another stored procedure. Called stored proc is as follows:

CREATE PROCEDURE sp_GetIndexInfo AS
BEGIN
DECLARE @id int, @indid int
SET @id = OBJECT_ID('authors')
SELECT @indid = indid
FROM sysindexes
WHERE id = @id
AND name = 'aunmind'

DBCC SHOWCONTIG (@id, @indid)
END


This stored proc gives the result as follows:

DBCC SHOWCONTIG scanning 'authors' table...
Table: 'authors' (117575457); index ID: 1, database ID: 5
TABLE level scan performed.
- Pages Scanned................................: 1
- Extents Scanned..............................: 1
- Extent Switches..............................: 0
- Avg. Pages per Extent........................: 1.0
- Scan Density [Best Count:Actual Count].......: 100.00% [1:1]
- Logical Scan Fragmentation ..................: 0.00%
- Extent Scan Fragmentation ...................: 0.00%
- Avg. Bytes Free per Page.....................: 6008.0
- Avg. Page Density (full).....................: 25.77%
DBCC execution completed. If DBCC printed error messages, contact your system administrator.

I want to show this result in a crystal report, so I want to make another stored proc which will use this stored proc & return the result in one column of the resultset. (One solution can be to use osql DOS command & create the text file then somehow read the file and put it in one column. But it does not sounds like a sophisticated solution. I've to do it for all indexes in every table.)
Please suggest me if you have any other idea.
Thanks




   

- Advertisement -