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
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical 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