"Rob Wahmann" <do**********@sbcglobal.net> wrote in message
news:eb********************@newssrv26.news.prodigy .com...
Re: exec sp_helpdb MyDB
Thanks, Simon. I've seen a lot of those commands thrown around but how do
I actually run that? I'm pretty new to SQL Server and I've never set up a
stored procedure or a trigger... I'm doing everything right now with
queries and an ODBC connection. These sites are relatively small but I do need to
learn this stuff so I can build more robust apps.
Thanks!
Rob
<snip>
Any procedure beginning with sp_ is a system stored procedure - most are in
the master database (some are in msdb) but you can execute the ones in
master from any database on the server. I don't know much about ODBC, but if
you're already passing queries to the server and getting results, then try
to just pass the query text "exec sp_helpdb MyDB" (without the quotes, of
course), and handle the results like any other query.
One thing to be aware of is that stored procedures may return multiple
result sets, so you have to parse each result set to get all the
information. sp_helpdb returns two result sets. Books Online is an excellent
reference for all the system stored procedures - they are all listed under
the "System Stored Procedures" topic (at least assuming you have SQL2000 -
you didn't mention your version).
Simon