Notifications
Clear all
BugOverflow
2
Posty
1
Users
0
Reactions
734
Widok
0
08/12/2021 8:30 am
Topic starter
example
2 Answers
0
08/12/2021 10:18 am
Topic starter
example
0
08/12/2021 10:52 am
Topic starter
1. create procedure inside master
2. Example content of procedure
SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- ============================================= -- Author: <Author,,Name> -- Create date: <Create Date,,> -- Description: <Description,,> -- ============================================= CREATE PROCEDURE MountDiskY AS BEGIN SET NOCOUNT ON; EXEC sp_configure 'show advanced options', '1'; RECONFIGURE EXEC sp_configure 'xp_cmdshell', '1'; RECONFIGURE EXEC xp_cmdshell 'NET USE Y: \\ /PERSISTENT:yes /user:my_user my_password' END GO
3. Right click and EXECUTE this script to create
4. after creation
5. Autostart procedure: click NEW QUERY
6. and type
USE MASTER GO EXEC SP_PROCOPTION MountBackupDiskY, 'STARTUP', 'ON' GO