• I wonder if you're missing the quote marks or if it was a copy/paste error.

    EXEC master.sys.sp_MSforeachdb

    N'INSERT INTO Dba_admin.dbo.databaseDataFileSize

    SELECT ''?'', SUM(size) * 8, cast(getdate() as date), cast(getdate() as time)

    FROM [?].sys.database_files

    WHERE type = 0;'

    PS. Depending on your database sizes, you might want to cast your size column as bigint.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2