SQL Script to attach a database
note: this script detaches it first
EXEC sp_detach_db @dbname = 'dbnametoattach'
EXEC sp_attach_single_file_db @dbname = 'dbnametoattach', @physname = 'c:\yourdirectory\dbnametoattach.mdf'
- Dan Lewis
Den här webbläsaren stöds inte längre.
Uppgradera till Microsoft Edge och dra nytta av de senaste funktionerna och säkerhetsuppdateringarna, samt teknisk support.
note: this script detaches it first
EXEC sp_detach_db @dbname = 'dbnametoattach'
EXEC sp_attach_single_file_db @dbname = 'dbnametoattach', @physname = 'c:\yourdirectory\dbnametoattach.mdf'
- Dan Lewis