Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2009
    Posts
    22

    Unanswered: Result of space_used into column?

    I have the following set up:

    EXEC msdb.dbo.sp_send_dbmail
    @profile_name='MyDBA',
    @recipients='jean@mydba.co.za',
    @subject='Database size of all Databases',
    @query='EXEC sp_msforeachdb @command1="use [?] exec sp_spaceused"',
    @body='@query'
    go

    This works perfectly, but I need to now add into the query a calculation that will output the percentage free as a column...?

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Unforuntately due to the fact that this sproc returns more than one resutlset when you do not pass parameters, we cannot even use INSERT INTO ... EXEC.

    However, some of this information can be obtained using sys.file_info and FILEPROPERTY (Transact-SQL)
    George
    Home | Blog

  3. #3
    Join Date
    Aug 2009
    Posts
    22
    Thanks G

    How do I pass parameters into the sproc to obtain fewer result sets?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •