• Perry Whittle (2/13/2013)


    I'm not being snarky that comment is a subtle hint.

    The old

    EXEC sp_attach_db @dbname = N'AdventureWorks2012', @filename1 =

    N'C:\Somepath\AdventureWorks2012_Data.mdf', @filename2 =

    N'C:\Somepath\AdventureWorks2012_log.ldf';

    The new

    CREATE DATABASE database_name

    ON PRIMARY (name=mydb_data, filename='d:\somepath\mydbdata.mdf')

    LOG ON (name=mydb_log, filename='e:\somepath\mydblog.ldf')

    FOR ATTACH

    Right...but the mere fact that you have to type in slightly different syntax to attach a database isn't by itself an argument to stop detatching and attaching databases. Not sure why you keep zeroing in on that. (for example: sp_adduser is depricated, and you now have to use CREATE USER...FOR LOGIN. But you don't go around telling people they shouldn't create users anymore just because sp_adduser is depricated.)

    All I was asking what the advantage to the method described in the article was over the detatch/attach method. You (sorta) listed some when you listed some (partially incorrect) cases where you couldn't detatch a database but could take it offline. That's the kind of thing I was asking.

    The Redneck DBA