Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to delete a file through query Analyser

Author  Topic 

PoojaJ
Starting Member

10 Posts

Posted - 2007-03-01 : 00:28:11
I am trying to restore a DB. After Detaching the DB I wanna delete the Ldf . How to delete this physical file Using Sql Query????

Thank You in advance.

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-03-01 : 00:31:29
use xp_cmdshell to execute the delete command


KH

Go to Top of Page

PoojaJ
Starting Member

10 Posts

Posted - 2007-03-01 : 01:22:57
Dont mind. But m pretty new to Sql so could u please help with the exact syntax... :)
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-03-01 : 01:49:44
[code]
exec xp_cmdshell 'DELETE c:\foldername\filename.ext'
[/code]


KH

Go to Top of Page
   

- Advertisement -