source http://technet.microsoft.com/en-us/library/ms162234%28SQL.100%29.aspx
code
//Connect to the local, default instance of SQL Server.
{
Server srv = default(Server);
srv = new Server();
//Create a linked server.
LinkedServer lsrv = default(LinkedServer);
lsrv = new LinkedServer(srv, "OLEDBSRV");
//When the product name is SQL Server the remaining properties are
//not required to be set.
lsrv.ProductName = "SQL Server";
lsrv.Create();
}
why to use default(Server),? -even if its like server asd = new asd(); it will still connect to the default instance!
why to use default(linkedserver) -whats the point? we still specify the srv and provider and product!
default
is nothing to do with the default SQL Server instance - it's purely a C# language construct (which, as all the answers point out, adds nothing here except confusion). I'm tempted to put in a bit of feedback asking that C# language examples are reviewed by an actual human who speaks C#... – Genesisgenet