use master go sp_detach_db 'mydb' go
use master go sp_attach_db 'mydb','E:Sqldatamydbdata.mdf','E:Sqldatamydblog.ldf' go
use mydb go sp_helpfile go