Use [Master]GO/** * * * * object:linkedserver [Xxx_lnk] Script DATE:2014/7/7 17:04:13 * * * * **/EXECMaster.dbo.sp_addlinkedserver@server =N'Xxx_lnk',@srvproduct=N'Xxx_lnk',@provider=N'SQLNCLI',@datasrc=N'xxx.xx.xxx.xx',@catalog=N'CMD' /*For security reasons the linked server remote logins password are changed with ########*/EXECMaster.dbo.sp_addlinkedsrvlogin@rmtsrvname=N'Xxx_lnk',@useself=N'False',@locallogin=NULL,@rmtuser=N'Dev',@rmtpassword='########'GOEXECMaster.dbo.sp_serveroption@server=N'Xxx_lnk',@optname=N'Collation Compatible',@optvalue=N'false'GOEXECMaster.dbo.sp_serveroption@server=N'Xxx_lnk',@optname=N'Data Access',@optvalue=N'true'GOEXECMaster.dbo.sp_serveroption@server=N'Xxx_lnk',@optname=N'Dist',@optvalue=N'false'GOEXECMaster.dbo.sp_serveroption@server=N'Xxx_lnk',@optname=N'Pub',@optvalue=N'false'GOEXECMaster.dbo.sp_serveroption@server=N'Xxx_lnk',@optname=N'RPC',@optvalue=N'true'GOEXECMaster.dbo.sp_serveroption@server=N'Xxx_lnk',@optname=N'RPC out',@optvalue=N'true'GOEXECMaster.dbo.sp_serveroption@server=N'Xxx_lnk',@optname=N'Sub',@optvalue=N'false'GOEXECMaster.dbo.sp_serveroption@server=N'Xxx_lnk',@optname=N'Connect Timeout',@optvalue=N'0'GOEXECMaster.dbo.sp_serveroption@server=N'Xxx_lnk',@optname=N'Collation Name',@optvalue=NULLGOEXECMaster.dbo.sp_serveroption@server=N'Xxx_lnk',@optname=N'Lazy Schema Validation',@optvalue=N'false'GOEXECMaster.dbo.sp_serveroption@server=N'Xxx_lnk',@optname=N'Query Timeout',@optvalue=N'0'GOEXECMaster.dbo.sp_serveroption@server=N'Xxx_lnk',@optname=N'Use remote collation',@optvalue=N'true'GOEXECMaster.dbo.sp_serveroption@server=N'Xxx_lnk',@optname=N'Remote proc Transaction promotion',@optvalue=N'true'GO