• What's wrong with just using sp_detach_db and create database for attach?

    If all you're doing here is detaching to move files then this is totally unnecessary anyway and is an old hangover from sql server 2000.

    To move files simply offline the database and use

    alter database ... Modify file ...

    Please see my article at this link[/url] for more info

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉