Help
i have delete log file *.ldf
how can i do to recovery mdf database
i do not detach database before ldf was be deleted.
thanks
For SQL 2005
USE [master]
GO
CREATE DATABASE [DBNAME] ON
(FILENAME = N'C:\DATA\DBNAME_DATA.mdf')
FOR ATTACH_REBUILD_LOG
GO
Replace databasename, drive petter, folder and file name.
For SQL 2000, Try
sp_attach_single_file_db [See booksonline for usage]
Thanks
Hari
"joseph" <desquestions@.gmail.com> wrote in message
news:etORcDkdHHA.3648@.TK2MSFTNGP05.phx.gbl...
> Help
> i have delete log file *.ldf
> how can i do to recovery mdf database
> i do not detach database before ldf was be deleted.
> thanks
|||Just note that this requires a clean shutdown of the database (no recovery work needed at startup).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:Ob32GTmdHHA.208@.TK2MSFTNGP05.phx.gbl...
> For SQL 2005
> USE [master]
> GO
> CREATE DATABASE [DBNAME] ON
> (FILENAME = N'C:\DATA\DBNAME_DATA.mdf')
> FOR ATTACH_REBUILD_LOG
> GO
> Replace databasename, drive petter, folder and file name.
> For SQL 2000, Try
> sp_attach_single_file_db [See booksonline for usage]
>
> Thanks
> Hari
> "joseph" <desquestions@.gmail.com> wrote in message news:etORcDkdHHA.3648@.TK2MSFTNGP05.phx.gbl...
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment