EXEC sp_addlinkedserver 'LNKName', '', 'MSDASQL', NULL, NULL, 'DRIVER={SQL Server};SERVER=ServerName;UID=UserName;PWD=password;' GOserver
exec sp_addlinkedsrvlogin 'LNKName','false',null,'UserName', 'password'word