Looking into to this more I do have a question:
So to add a linked server you use sp_addlinkedserver and to delete it you use sp_dropserver?
Not a great naming convention on someone's part, but yes.
sp_addserver is unrelated?
You won't need to call sp_addserver directly for Linked Server creation. sys.sp_addlinkedserver actually calls an internal version of sp_addserver called sys.sp_MSaddserver_internal and you will see a new entry in sys.servers after you create a new Linked Server with sys.sp_addlinkedserver.
Is it possible to alter a linked server, i.e. change what it points to, or do you just drop and create again?
I don't see a way to modify where it is pointing, just some of the options.
You can always check for existence before dropping it:
IF EXISTS ( SELECT *
WHERE name = N'Production' )
@server = N'Production',
@droplogins = 'droplogins';
__________________________________________________________________________________________________There are no special teachers of virtue, because virtue is taught by the whole community. --Plato