SQL Server Maintenance Plan TSQL query to log the backup databases Does anyone know how to use the TSQL task in SQL Server 2008 Maintenance Plan to log (insert) the databases that where backed-up?

Imagine a Maintenance Plan that does the backup for DB1,DB2 and DB3.

I wanted a way to do 

INSERT INTO LOG VALUES (BD1,...)
INSERT INTO LOG VALUES (BD2,...)
INSERT INTO LOG VALUES (BD3,...)


But I did not want to statically type this, but have a generic SQL that knows which DBs where backup and insert those.

Thanks
I would recommend using these free backup (and other) scripts from http://ola.hallengren.com/

These have full logging already and have lots of other useful options.

Personally, these are what I use. Thoroughly tested and used by many, many folk.