Re: Problem with way to access all recordsets returned by sp_spaceused using ODBC APIs on C++
- From: "Ashutosh" <ashutosh_pund@xxxxxxxxx>
- Date: 13 Dec 2006 22:56:13 -0800
Thanx alot for your help :)!
Chris Kushnir wrote:
exec sp_spaceused returns:
Result set 1:
database_name
database_size
unallocated space
Result set 2:
reserved
data
index_size
unused
So, from your description you are trying to get database_size (col2) from
first result set, and unused (col4) from second result set.
You have to:
SQLExecDirect()
SQLBindCol( database_name, col2 )
SQLFetch() until all records read from first result set
SQLMoreResults() if returns SQL_SUCESS then you have another result set, so
...
SQLFreeStmt( SQL_UNBIND )
SQLBindCol( unused, col4 )
SQLFetch() until all records read from second result set
cmk
.
- References:
- Prev by Date: Re: Help I am getting an error when I run my insert statement
- Next by Date: Re: Help I am getting an error when I run my insert statement
- Previous by thread: Re: Problem with way to access all recordsets returned by sp_spaceused using ODBC APIs on C++
- Index(es):
Relevant Pages
|