|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Tuesday, November 13, 2012 2:32 PM
Points: 16,
Visits: 129
|
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, December 22, 2011 1:07 PM
Points: 1,
Visits: 13
|
|
I tried your method and it does not work - for example:
USE ENTERPRISE_SERVERS GO
EXEC master.dbo.sp_dboption 'ENTERPRISE_SERVERS','autoclose',true GO
DECLARE @cmd VARCHAR(255) SET @cmd = 'copy C:\SQLDATA\ENTERPRISE_SERVERS.mdf "C:\BACKUPS\"'
EXEC master.dbo.xp_cmdshell @cmd
EXEC master.dbo.sp_dboption 'ENTERPRISE_SERVERS','autoclose',false GO
..................returns the folllowing error:
The process cannot access the file because it is being used by another process.
...........which defeats the purpose
|
|
|
|