DBA Sensation

August 28, 2012

attached database with single MDF file

Filed under: 3. MS SQL Server — Tags: , , — zhefeng @ 12:15 pm

i need to attach some database and don’t want to copy over the log files, here is how:
EXEC sp_attach_single_file_db @dbname=’TestDb’,
@physname=N’C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\TestDb.mdf’

After run it, sql server will make a log file for you.

Create a free website or blog at WordPress.com.