How do I call the Stored Procedure sp_addserver from C# with the local switch?
In SSMS I can call add server like this:
EXEC sp_addserver 'MYNEWSERVERNAME',local
My relevant code as of now:
cmd.CommandText = "sp_addserver";
cmd.Parameters.Clear();
cmd.Parameters.Add(new SqlParameter("@server", "MYNEWSERVER"));
cmd.ExecuteNonQuery();
This errors out as sp_addserver is not supported without the local switch.