distributor_admin 登录名的密码。password 的数据类型为 sysname,默认值为 NULL。 如果为 NULL 或空字符串,则密码重置为随机值。 必须在添加第一个远程分发服务器时配置密码。distributor_admin 登录名和 password 是为用于 distributor RPC 连接(包括本地连接)的链接服务器条目存储的。 如果 distributor 为本地分发服务器,则 distributor_admin 的密码设置为新值。 对于具有远程分发服务器的发布服务器,必须在 sp_adddistributor 在发布服务器和分发服务器上同时执行时指定同一个 password 值。sp_adddistributor 用于快照复制、事务复制和合并复制。解决方法: 我刚刚解决这种情况,你在EM中注册服务器的时候,一定要是你SQL SERVER服务器启动的名字!如果是IP地址的注册服务器,就会出现此种情况! 另一种的解决方法如下: Try select @@servername . If different from the actual server name, then use sp_dropserver 'oldservername ' and after that sp_addserver 'actualservername ', 'local ' followed by a restart of the SQL service. 中文意思: 在查询分析器中运行 select @@servername 查看电脑名,如果跟当前电脑名不一样,则需要如下操作。 第一步:删除现在的服务名 oldservername为上面select @@servername返回的名称。 sp_dropserver 'oldservername' 第二步:添加当面电脑名其实sqlserver的名称跟电脑名是一样的。actualservername为电脑名。 sp_addserver 'actualservername', 'local' 第三步:重启sqlserver即可。电脑名的查看方法:我的电脑右键属性详细出处参考:http://www.jb51.net/article/24360.htm
--给你一个例子吧 -- This script uses sqlcmd scripting variables. They are in the form -- $(MyVariable). For information about how to use scripting variables -- on the command line and in SQL Server Management Studio, see the -- "Executing Replication Scripts" section in the topic -- "Programming Replication Using System Stored Procedures".-- Install the Distributor and the distribution database. DECLARE @distributor AS sysname; DECLARE @distributionDB AS sysname; DECLARE @publisher AS sysname; DECLARE @directory AS nvarchar(500); DECLARE @publicationDB AS sysname; -- Specify the Distributor name. SET @distributor = $(DistPubServer); -- Specify the distribution database. SET @distributionDB = N'distribution'; -- Specify the Publisher name. SET @publisher = $(DistPubServer); -- Specify the replication working directory. SET @directory = N'\\' + $(DistPubServer) + '\repldata'; -- Specify the publication database. SET @publicationDB = N'AdventureWorks2008R2'; -- Install the server MYDISTPUB as a Distributor using the defaults, -- including autogenerating the distributor password. USE master EXEC sp_adddistributor @distributor = @distributor;-- Create a new distribution database using the defaults, including -- using Windows Authentication. USE master EXEC sp_adddistributiondb @database = @distributionDB, @security_mode = 1; GO-- Create a Publisher and enable AdventureWorks2008R2 for replication. -- Add MYDISTPUB as a publisher with MYDISTPUB as a local distributor -- and use Windows Authentication. DECLARE @distributionDB AS sysname; DECLARE @publisher AS sysname; -- Specify the distribution database. SET @distributionDB = N'distribution'; -- Specify the Publisher name. SET @publisher = $(DistPubServer);USE [distribution] EXEC sp_adddistpublisher @publisher=@publisher, @distribution_db=@distributionDB, @security_mode = 1; GO
另一种的解决方法如下:
Try select @@servername . If different from the actual server name, then use
sp_dropserver 'oldservername ' and after that sp_addserver 'actualservername ', 'local '
followed by a restart of the SQL service. 中文意思:
在查询分析器中运行 select @@servername 查看电脑名,如果跟当前电脑名不一样,则需要如下操作。 第一步:删除现在的服务名 oldservername为上面select @@servername返回的名称。
sp_dropserver 'oldservername' 第二步:添加当面电脑名其实sqlserver的名称跟电脑名是一样的。actualservername为电脑名。
sp_addserver 'actualservername', 'local' 第三步:重启sqlserver即可。电脑名的查看方法:我的电脑右键属性详细出处参考:http://www.jb51.net/article/24360.htm
-- This script uses sqlcmd scripting variables. They are in the form
-- $(MyVariable). For information about how to use scripting variables
-- on the command line and in SQL Server Management Studio, see the
-- "Executing Replication Scripts" section in the topic
-- "Programming Replication Using System Stored Procedures".-- Install the Distributor and the distribution database.
DECLARE @distributor AS sysname;
DECLARE @distributionDB AS sysname;
DECLARE @publisher AS sysname;
DECLARE @directory AS nvarchar(500);
DECLARE @publicationDB AS sysname;
-- Specify the Distributor name.
SET @distributor = $(DistPubServer);
-- Specify the distribution database.
SET @distributionDB = N'distribution';
-- Specify the Publisher name.
SET @publisher = $(DistPubServer);
-- Specify the replication working directory.
SET @directory = N'\\' + $(DistPubServer) + '\repldata';
-- Specify the publication database.
SET @publicationDB = N'AdventureWorks2008R2'; -- Install the server MYDISTPUB as a Distributor using the defaults,
-- including autogenerating the distributor password.
USE master
EXEC sp_adddistributor @distributor = @distributor;-- Create a new distribution database using the defaults, including
-- using Windows Authentication.
USE master
EXEC sp_adddistributiondb @database = @distributionDB,
@security_mode = 1;
GO-- Create a Publisher and enable AdventureWorks2008R2 for replication.
-- Add MYDISTPUB as a publisher with MYDISTPUB as a local distributor
-- and use Windows Authentication.
DECLARE @distributionDB AS sysname;
DECLARE @publisher AS sysname;
-- Specify the distribution database.
SET @distributionDB = N'distribution';
-- Specify the Publisher name.
SET @publisher = $(DistPubServer);USE [distribution]
EXEC sp_adddistpublisher @publisher=@publisher,
@distribution_db=@distributionDB,
@security_mode = 1;
GO