• Sure. @perry Whittle,

    But what, if you have more than 50 or 100 databases or each database has multiple ldf & log files.

    Will you write the query.

    The script is for those server. I created this script for my production & successfully detach & attach 66 databases each had 4 or 5 files.

    Vimal LohaniSQL DBA | MCP (70-461,70-462)==============================The greatest barrier to success is the fear of failure ** Success is a journey not a destination**Think before you print, SAVE TREES, Protect Mother Nature