Restore Database backup from network

First you need to share that network folder with you user name,
Then Remote to the server on which you want to restore database, Go to My computer and map network drive after mapping execute the below script by changing path, username and password according to your server

 EXEC sp_configure 'show advanced options', 1

GO

-- To update the currently configured value for advanced options.

RECONFIGURE

GO

-- To enable the feature.

EXEC sp_configure 'xp_cmdshell', 1

GO

-- To update the currently configured value for this feature.

RECONFIGURE

GO
EXEC xp_cmdshell 'NET USE Z: \\SystemName\FolderName PasswordofUser /USER:YourUserName@domain.com'



if some drive is already mapped for the same user then you have to delete first one by below script.
EXEC xp_cmdshell 'net use Y: /delete'

Comments

Popular posts from this blog

TSQL To Get All the Names of tables and Databases whose data have changed in last 24 Hours

To Get All the Names of tables and Databases their data have changed in last 24 Hours And Backup those databases

Apply paging in procedure