SQL Server Attach DB 沒有 LDF

若不是乾淨地 Deattach,造成 ldf 和 mdf 並不一致。則沒有 ldf 時僅使用 ATTACH_REBUILD_LOG 選項仍會失敗,可以考慮 attach_force_rebuild_log 選項,例如

create database northwind on(filename=’C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQL2K8R2\MSSQL\DATA\Northwind.mdf’) for attach_force_rebuild_log

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 變更 )

Twitter picture

You are commenting using your Twitter account. Log Out / 變更 )

Facebook照片

You are commenting using your Facebook account. Log Out / 變更 )

Google+ photo

You are commenting using your Google+ account. Log Out / 變更 )

連結到 %s

%d 位部落客按了讚: