Sp_dropserver [@ Server =] 'server'
[, [@ Droplogins =] {'droplogins' | null}]
Parameters
[@ Server =] 'server'
The server to be deleted. The data type of the server is sysname, with no default value. The server must already exist.
[@ Droplogins =] 'droplogins' | null
Specify that if droplogins is specified, the related remote and linked server logon for the server will also be deleted. @ Droplogins the data type is Char (10) with the default value null.
Return code value
0 (successful) or 1 (failed)
Note
If a server has related remote and linked server logon entries, when running sp_dropserver on the server, an error message is returned. This message indicates that before deleting a remote or linked server, you must first delete the related logon. When deleting a server, use the droplogins parameter to delete all remote and linked server logins.
Sp_dropserver cannot be executed in a user-defined transaction.
Permission
Only members of the SysAdmin or setupadmin fixed server role can execute sp_dropserver.