for Backup I want my SQLServer to connect to a network share with Password and username (can't do that in Delphi, cause SQLServer is running as "Local System" and can not reach devices with user login of course).
This works in Management Studio with following script:
Code: Select all
EXEC sp_configure 'show advanced options', 1
RECONFIGURE
EXEC sp_configure 'xp_cmdshell', 1
RECONFIGURE
EXEC xp_cmdshell 'NET USE X: "\\Machine\Share" MyPassword /USER:MyUsername /PERSISTENT:no'
BACKUP DATABASE XY TO DISK = 'X:\test1.bak'
EXEC xp_cmdshell 'NET USE X: /delete'
EXEC sp_configure 'xp_cmdshell', 0
RECONFIGURE
EXEC sp_configure 'show advanced options', 0
RECONFIGURE
Other Lines are!
Does anybody has an idea?
best regards
Hans