sp_detach_db test
D:\DBDataTest> copy D:\DBDataTest\test.mdf D:\test\DBData\ D:\DBDataTest> copy D:\DBDataTest\test_log.ldf D:\test\DBData\
sp_attach_db 'test','D:\test\DBData\test.mdf','D:\test\DBData\test_log.ldf'