<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" version="2.0">
  <channel>
    <title>Manuel Abadia's ASP.NET stuff - SQL Server</title>
    <link>http://www.manuelabadia.com/blog/</link>
    <description />
    <language>en-us</language>
    <copyright>Manuel Abadia</copyright>
    <lastBuildDate>Thu, 27 Sep 2007 10:59:52 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 1.9.6264.0</generator>
    <managingEditor>blogcomments@manuelabadia.com</managingEditor>
    <webMaster>blogcomments@manuelabadia.com</webMaster>
    <item>
      <trackback:ping>http://www.manuelabadia.com/blog/Trackback.aspx?guid=ea42d3b6-d589-46bf-9d09-7af075e834f3</trackback:ping>
      <pingback:server>http://www.manuelabadia.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.manuelabadia.com/blog/PermaLink,guid,ea42d3b6-d589-46bf-9d09-7af075e834f3.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://www.manuelabadia.com/blog/CommentView,guid,ea42d3b6-d589-46bf-9d09-7af075e834f3.aspx</wfw:comment>
      <wfw:commentRss>http://www.manuelabadia.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=ea42d3b6-d589-46bf-9d09-7af075e834f3</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
The last two books I read were excellent so I'm recommending them:
</p>
        <p>
          <strong>
            <em>Professional ASP.NET 2.0 Security, Membership, and Role Management.</em>
          </strong>
        </p>
        <iframe style="WIDTH: 120px; HEIGHT: 240px" marginwidth="0" marginheight="0" src="http://rcm.amazon.com/e/cm?t=manuelabadias-20&amp;o=1&amp;p=8&amp;l=as1&amp;asins=0764596985&amp;fc1=000000&amp;IS2=1&amp;lt1=_blank&amp;lc1=0000FF&amp;bc1=000000&amp;bg1=FFFFFF&amp;f=ifr" frameborder="0" scrolling="no">
        </iframe>
        <p>
          <br />
Stefan Schackow is the author of this book. He is a Program Manager on the ASP.NET
team so he really knows what he is talking about.
</p>
        <p>
The book covers the life of a request from IIS to ASP.NET, in an incredibly level
of detail, explaining what happens in some lifecycle events. It analyzes the 3 different
identities used in an asp.net request, trust levels, security in the configuration
files, forms authentication, session state, page security, the provider model, and
the membership and role provider. Also includes an understandable section about CAS,
something difficult to find.
</p>
        <p>
The explanations provided in this book are awesome. Incredibly detailed. It feels
like you're following the fully commented ASP.NET source code while reading some parts. 
</p>
        <p>
I was so hooked up when I started to read it that I didn't stop until I finished the
first 5 chapters! I wish I had read this book earlier. Definitely one of the best
ASP.NET books of all time.
</p>
        <p>
          <em>
            <strong>Microsoft SQL Server 2005 Integration Services</strong>
          </em>
        </p>
        <iframe style="WIDTH: 120px; HEIGHT: 240px" marginwidth="0" marginheight="0" src="http://rcm.amazon.com/e/cm?t=manuelabadias-20&amp;o=1&amp;p=8&amp;l=as1&amp;asins=0672327813&amp;fc1=000000&amp;IS2=1&amp;lt1=_blank&amp;lc1=0000FF&amp;bc1=000000&amp;bg1=FFFFFF&amp;f=ifr" frameborder="0" scrolling="no">
        </iframe>
        <p>
          <br />
This one is written by Kirk Haselden, a Development Manager on the SSIS team.
</p>
        <p>
I have read a couple of SSIS books before this one, and they have helped me to be
comfortable using SSIS. However, this book explained some things that weren't covered
by other books or if they were covered, they weren't explained very well. Thanks to
this book now I'm an advanced SSIS user. However, I'm not sure if this book will be
useful to a complete newbie to SSIS, so be warned if that's your case. 
</p>
        <img width="0" height="0" src="http://www.manuelabadia.com/blog/aggbug.ashx?id=ea42d3b6-d589-46bf-9d09-7af075e834f3" />
      </body>
      <title>Recommended Reading</title>
      <guid isPermaLink="false">http://www.manuelabadia.com/blog/PermaLink,guid,ea42d3b6-d589-46bf-9d09-7af075e834f3.aspx</guid>
      <link>http://www.manuelabadia.com/blog/PermaLink,guid,ea42d3b6-d589-46bf-9d09-7af075e834f3.aspx</link>
      <pubDate>Thu, 27 Sep 2007 10:59:52 GMT</pubDate>
      <description>&lt;p&gt;
The last two books I read were excellent so I'm recommending them:
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;&lt;em&gt;Professional ASP.NET 2.0 Security, Membership, and Role Management.&lt;/em&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;iframe style="WIDTH: 120px; HEIGHT: 240px" marginwidth=0 marginheight=0 src="http://rcm.amazon.com/e/cm?t=manuelabadias-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=as1&amp;amp;asins=0764596985&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr" frameborder=0 scrolling=no&gt;
&lt;/iframe&gt;
&lt;p&gt;
&lt;br&gt;
Stefan Schackow is the author of this book. He is a Program Manager on the ASP.NET
team so he really knows what he is talking about.
&lt;/p&gt;
&lt;p&gt;
The book covers the life of a request from IIS to ASP.NET, in an incredibly level
of detail, explaining what happens in some lifecycle events. It analyzes the 3 different
identities used in an asp.net request, trust levels, security in the configuration
files, forms authentication, session state, page security, the provider model, and
the membership and role provider. Also includes an understandable section about CAS,
something difficult to find.
&lt;/p&gt;
&lt;p&gt;
The explanations provided in this book are awesome. Incredibly detailed. It feels
like you're following the fully commented ASP.NET source code while reading some parts. 
&lt;/p&gt;
&lt;p&gt;
I was so hooked up when I started to read it that I didn't stop until I finished the
first 5 chapters! I wish I had read this book earlier. Definitely one of the best
ASP.NET books of all time.
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;&lt;strong&gt;Microsoft SQL Server 2005 Integration Services&lt;/strong&gt;&lt;/em&gt;
&lt;/p&gt;
&lt;iframe style="WIDTH: 120px; HEIGHT: 240px" marginwidth=0 marginheight=0 src="http://rcm.amazon.com/e/cm?t=manuelabadias-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=as1&amp;amp;asins=0672327813&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr" frameborder=0 scrolling=no&gt;
&lt;/iframe&gt;
&lt;p&gt;
&lt;br&gt;
This one is written by Kirk Haselden, a Development Manager on the SSIS team.
&lt;/p&gt;
&lt;p&gt;
I have read a couple of SSIS books before this one, and they have helped me to be
comfortable using SSIS. However, this book explained some things that weren't covered
by other books or if they were covered, they weren't explained very well. Thanks to
this book now I'm an advanced SSIS user. However, I'm not sure if this book will be
useful to a complete newbie to SSIS, so be warned if that's your case. 
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.manuelabadia.com/blog/aggbug.ashx?id=ea42d3b6-d589-46bf-9d09-7af075e834f3" /&gt;</description>
      <comments>http://www.manuelabadia.com/blog/CommentView,guid,ea42d3b6-d589-46bf-9d09-7af075e834f3.aspx</comments>
      <category>ASP.NET;Books;SQL Server;SSIS</category>
    </item>
    <item>
      <trackback:ping>http://www.manuelabadia.com/blog/Trackback.aspx?guid=7228d85d-c0c4-4497-be63-1fa5edcf6fa3</trackback:ping>
      <pingback:server>http://www.manuelabadia.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.manuelabadia.com/blog/PermaLink,guid,7228d85d-c0c4-4497-be63-1fa5edcf6fa3.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://www.manuelabadia.com/blog/CommentView,guid,7228d85d-c0c4-4497-be63-1fa5edcf6fa3.aspx</wfw:comment>
      <wfw:commentRss>http://www.manuelabadia.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=7228d85d-c0c4-4497-be63-1fa5edcf6fa3</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Recently I had to configure merge replication between a configuration like this one:
</p>
        <p>
          <img src="http://www.manuelabadia.com/blog/content/binary/esquema_firewall.jpg" border="0" />
        </p>
        <p>
It was my first experience with replication and it was a pain in the ass to have everything
configured properly in order to get replication to work. So I'm going to detail what
the necessary steps for this so it can help others and also it will help me in the
future if I need to do this again.
</p>
        <p>
The basic steps are:
</p>
        <p>
1) set up the initial configuration<br />
2) set up the distributor<br />
3) set up the publisher<br />
4) set up the subscriber
</p>
        <p>
          <strong>Initial Configuration</strong>
        </p>
        <p>
I'll call the servers A and B. A will be the publisher and B the subscriber. Both
servers have SQL Server 2005 installed. 
</p>
        <p>
I had some problems because server B initially was a named instance and was using
dynamic ports. Even if I change server B to use the port 1433, more problems appear
later because server A wasn't able to find the instance in server B in the replication
process so I suggest you to use default instances in both servers and use the SQL
Server default port.
</p>
        <p>
To configure the firewalls be sure to open TCP port 1433 for incoming and outgoing
traffic.
</p>
        <p>
Replication doesn't work if you try to set up using the IP for a server. It needs
the server name so you'll have to create an alias for each machine.
</p>
        <p>
In server A, open SQL Server Configuration Manager, and add a new alias in SQL Native
Client Configuration. Set the alias name to be the same as the name of server B, and
the server to be the IP of server B.
</p>
        <p>
Repeat the above step to create an alias in server B for server A.
</p>
        <p>
If you're using a 64 bit edition of SQL Server you'll have two SQL Native Client Configuration
entries, one for 32 bits and another for 64 bits. If you are going to connect to another
64 bit instance, add the alias in the 64 bit entry. Otherwise add it to the 32 bit
instance.
</p>
        <p>
Connect to server A using Remote desktop, open a SQL Server Management Console (SSMC)
and try to connect to server B using the server name, not the IP. If the connection
isn't working you have done something wrong, so verify the steps above. Repeat the
same to check if you can connect to server A from server B.
</p>
        <p>
          <strong>Configuring the Distributor</strong>
        </p>
        <p>
Open a SSMC and connect to server B. Right click in the Replication node in the Object
Explorer and select Configure Distribution. Choose that the server B will act as its
own distributor. Then choose a location for the snapshot folder. The default is:
</p>
        <p>
C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\ReplData
</p>
        <p>
Remember the location because it will be needed later.
</p>
        <p>
The next step is to create the distribution database. After that, you have to enable
the server A to use the distributor in server B to publish data, adding it to the
list of allowed publishers (by default only the machine where the distributor executes
is allowed).
</p>
        <p>
When you have remote publishers, you have to specify a distributor password in order
for the publisher to connect to the distributor.
</p>
        <p>
When a new publication is created, the distributor stores a snapshot of the publication
in the snapshot folder. As we're configuring a pull subscription the snapshot will
be stored in the server B, where the distributor is. The snapshot agent will be started,
and it will connect to the publisher, the distributor and generate a snapshot in the
snapshot folder.
</p>
        <p>
For this to work you have to create an user account in server B for the snapshot agent
(for example, usrSnapshotAgent). The snapshot agent needs write permissions for the
snapshot folder, and a windows login for SQL Server, with db_owner permissions for
the distribution database.
</p>
        <p>
You'll have to create a SQL server login (for example, db_usrSnapshotAgent) in the
server A to allow the snapshot agent to access the publication database.
</p>
        <p>
If everything goes well you'll have the distributor working. Probably you'll want
to configure the distributor properties (right click in the Replication node and select
Distributor Properties) to set a retention period that fits in your requirements.
</p>
        <p>
          <strong>Configuring the Publisher</strong>
        </p>
        <p>
Open a SSMC and connect to server A. Right click in the Replication-&gt;Local Publications
node in the Object Explorer and select new Publication.
</p>
        <p>
Select the distributor, the database to publish, the publication type (merge publication)
and the articles to publish. After that the Snapshot agent wizard step is presented.
It has two options: Create snapshot inmediately and Schedule the snapshot agent to
run at a predefined schedule. Be sure that the first option is checked. Only check
the second one if there is a chance that you'll add more subscribers in the future. 
</p>
        <p>
The next wizard step is where you configure the snapshot agent security. Set the process
to run using the windows user account created previously (usrSnapshotAgent), and use
the SQL serer login created when configuring the distributor (db_usrSnapshotAgent)
to allow the snapshot agent to connect to the subscriber. 
</p>
        <p>
To check if the publication has been succesfully initialized and the snapshot was
generated properly, right click in the publication name in the Replication-&gt;Local
Publications node from SSMC of server A and select View Snapshot Agent Status. If
an error surfaces, check the job history and try to find out what failed. 
</p>
        <p>
Be sure to select the properties of the publication in order to tune other publication
parameters that are not shown in the wizard, like the subscription expiration options.  
</p>
        <p>
During tests I obtained the following error:
</p>
        <p>
The snapshot could not be generated because the publisher is inactive.
</p>
        <p>
It can be fixed typing this in a new query window for server B:
</p>
        <p>
sp_changedistpublisher 'server A', 'active', 'true'
</p>
        <p>
If you think you have found the problem, view the status of the snapshot agent and
click restart.
</p>
        <p>
Once you have the snapshot generated without problems you can start configuring the
subscriber.
</p>
        <p>
          <strong>Configuring the Subscriber</strong>
        </p>
        <p>
The merge agent will execute in server B and it will need to connect to the distributor,
to the publisher and to the subscriber, so we need to create a windows user account
for it in server B (usrMergeAgent). This windows user account needs read permissions
for the snapshot folder and db_owner permissions for the distributor and subscriber
databses. A SQL server login needs to be created in server A (for example, db_usrMergeAgent)
with db_owner permissions for the publication database.
</p>
        <p>
For this to work you have to create an user account in server B for the snapshot agent
(for example, usrSnapshotAgent). The snapshot agent needs write permissions for the
snapshot folder, and a windows login for SQL Server, with db_owner permissions for
the distribution database.
</p>
        <p>
Open a SSMC and connect to server B. Right click in the Replication-&gt;Local Subscriptions
node in the Object Explorer and select New Subscription. Select the server A as the
publisher and the publication created in the previous step.
</p>
        <p>
Select pull subscription and the databse where the data will be replicated.
</p>
        <p>
The next wizard page is where you configure the security for the merge agent. Select
to run the merge agent under the windows account created previously (usrMergeAgent)
and choose to connect to the publisher, distributor and subscriber by impersonating
the process account. We'll connect to the publisher using a SQL Server login but in
this wizard we can't configure the publisher and distributor differently.
</p>
        <p>
The next step is to set up how often the merge agent synchronizes the data. This will
depend on your replication requirements.
</p>
        <p>
Finally, you have to specify if the subscription will be initialized automatically
and when (select yes and inmediately), and the type of subscription (server or client).
</p>
        <p>
If you view the synchronization status, the synchronization failed. This is because
we configured the merge agent to connect to the publisher impersonating the merge
agent account. If we modify the subscription options and change publisher connection
to use the db_usrMergeAgent.
</p>
        <p>
If you have done everything properly it should work. The error message:
</p>
        <p>
The merge process could not connect to the Publisher 'ServerA:publication'. Check
to ensure that the server is running.  
</p>
        <p>
usually appears if there is an error with the permissions in the merge agent.
</p>
        <p>
As you can see there are a ton of steps to do and it is a very error prone process.
However this is not because it is a difficult concept. It is easy to understand all
the agents related to replication. However the number of accounts involved and all
the security permissions needed make it difficult.
</p>
        <p>
Once you have properly configured replication, it seems to work quite good. Anyway,
probably it is a good idea to configure Database mail to be notified of any error
in the replication process.<br /></p>
        <img width="0" height="0" src="http://www.manuelabadia.com/blog/aggbug.ashx?id=7228d85d-c0c4-4497-be63-1fa5edcf6fa3" />
      </body>
      <title>Merge Replication across internet using Pull Subscriptions</title>
      <guid isPermaLink="false">http://www.manuelabadia.com/blog/PermaLink,guid,7228d85d-c0c4-4497-be63-1fa5edcf6fa3.aspx</guid>
      <link>http://www.manuelabadia.com/blog/PermaLink,guid,7228d85d-c0c4-4497-be63-1fa5edcf6fa3.aspx</link>
      <pubDate>Sun, 11 Feb 2007 23:22:06 GMT</pubDate>
      <description>&lt;p&gt;
Recently I had to configure merge replication between a configuration like this one:
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://www.manuelabadia.com/blog/content/binary/esquema_firewall.jpg" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
It was my first experience with replication and it was a pain in the ass to have everything
configured properly in order to get replication to work. So I'm going to detail what
the necessary steps for this so it can help others and also it will help me in the
future if I need to do this again.
&lt;/p&gt;
&lt;p&gt;
The basic steps are:
&lt;/p&gt;
&lt;p&gt;
1) set up the initial configuration&lt;br&gt;
2) set up the distributor&lt;br&gt;
3) set up the publisher&lt;br&gt;
4) set up the subscriber
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Initial Configuration&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
I'll call the servers A and B. A will be the publisher and B the subscriber. Both
servers have SQL Server 2005 installed. 
&lt;/p&gt;
&lt;p&gt;
I had some problems because server B initially was a named instance and was using
dynamic ports. Even if I change server B to use the port 1433, more problems appear
later because server A wasn't able to find the instance in server B in the replication
process so I suggest you to use default instances in both servers and use the SQL
Server default port.
&lt;/p&gt;
&lt;p&gt;
To configure the firewalls be sure to open TCP port 1433 for incoming and outgoing
traffic.
&lt;/p&gt;
&lt;p&gt;
Replication doesn't work if you try to set up using the IP for a server. It needs
the server name so you'll have to create an alias for each machine.
&lt;/p&gt;
&lt;p&gt;
In server A, open SQL Server Configuration Manager, and add a new alias in SQL Native
Client Configuration. Set the alias name to be the same as the name of server B, and
the server to be the IP of server B.
&lt;/p&gt;
&lt;p&gt;
Repeat the above step to create an alias in server B for server A.
&lt;/p&gt;
&lt;p&gt;
If you're using a 64 bit edition of SQL Server you'll have two SQL Native Client Configuration
entries, one for 32 bits and another for 64 bits. If you are going to connect to another
64 bit instance, add the alias in the 64 bit entry. Otherwise add it to the 32 bit
instance.
&lt;/p&gt;
&lt;p&gt;
Connect to server A using Remote desktop, open a SQL Server Management Console (SSMC)
and try to connect to server B using the server name, not the IP. If the connection
isn't working you have done something wrong, so verify the steps above. Repeat the
same to check if you can connect to server A from server B.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Configuring the Distributor&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
Open a SSMC and connect to server B. Right click in the Replication node in the Object
Explorer and select Configure Distribution. Choose that the server B will act as its
own distributor. Then choose a location for the snapshot folder. The default is:
&lt;/p&gt;
&lt;p&gt;
C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\ReplData
&lt;/p&gt;
&lt;p&gt;
Remember the location because it will be needed later.
&lt;/p&gt;
&lt;p&gt;
The next step is to create the distribution database. After that, you have to enable
the server A to use the distributor in server B to publish data, adding it to the
list of allowed publishers (by default only the machine where the distributor executes
is allowed).
&lt;/p&gt;
&lt;p&gt;
When you have remote publishers, you have to specify a distributor password in order
for the publisher to connect to the distributor.
&lt;/p&gt;
&lt;p&gt;
When a new publication is created, the distributor stores a snapshot of the publication
in the snapshot folder. As we're configuring a pull subscription the snapshot will
be stored in the server B, where the distributor is. The snapshot agent will be started,
and it will connect to the publisher, the distributor and generate a snapshot in the
snapshot folder.
&lt;/p&gt;
&lt;p&gt;
For this to work you have to create an user account in server B for the snapshot agent
(for example, usrSnapshotAgent). The snapshot agent needs write permissions for the
snapshot folder, and a windows login for SQL Server, with db_owner permissions for
the distribution database.
&lt;/p&gt;
&lt;p&gt;
You'll have to create a SQL server login (for example, db_usrSnapshotAgent) in the
server A to allow the snapshot agent to access the publication database.
&lt;/p&gt;
&lt;p&gt;
If everything goes well you'll have the distributor working. Probably you'll want
to configure the distributor properties (right click in the Replication node and select
Distributor Properties) to set a retention period that fits in your requirements.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Configuring the Publisher&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
Open a SSMC and connect to server A. Right click in the Replication-&amp;gt;Local Publications
node in the Object Explorer and select new Publication.
&lt;/p&gt;
&lt;p&gt;
Select the distributor, the database to publish, the publication type (merge publication)
and the articles to publish. After that the Snapshot agent wizard step is presented.
It has two options: Create snapshot inmediately and Schedule the snapshot agent to
run at a predefined schedule. Be sure that the first option is checked. Only check
the second one if there is a chance that you'll add more subscribers in the future. 
&lt;/p&gt;
&lt;p&gt;
The next wizard step is where you configure the snapshot agent security. Set the process
to run using the windows user account created previously (usrSnapshotAgent), and use
the SQL serer login created when configuring the distributor (db_usrSnapshotAgent)
to allow the snapshot agent to connect to the subscriber. 
&lt;/p&gt;
&lt;p&gt;
To check if the publication has been succesfully initialized and the snapshot was
generated properly, right click in the publication name in the Replication-&amp;gt;Local
Publications node from SSMC of server A and select View Snapshot Agent Status. If
an error surfaces, check the job history and try to find out what failed. 
&lt;/p&gt;
&lt;p&gt;
Be sure to select the properties of the publication in order to tune other publication
parameters that are not shown in the wizard, like the subscription expiration options.&amp;nbsp; 
&lt;/p&gt;
&lt;p&gt;
During tests I obtained the following error:
&lt;/p&gt;
&lt;p&gt;
The snapshot could not be generated because the publisher is inactive.
&lt;/p&gt;
&lt;p&gt;
It can be fixed typing this in a new query window for server B:
&lt;/p&gt;
&lt;p&gt;
sp_changedistpublisher 'server A', 'active', 'true'
&lt;/p&gt;
&lt;p&gt;
If you think you have found the problem, view the status of the snapshot agent and
click restart.
&lt;/p&gt;
&lt;p&gt;
Once you have the snapshot generated without problems you can start configuring the
subscriber.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Configuring the Subscriber&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
The merge agent will execute in server B and it will need to connect to the distributor,
to the publisher and to the subscriber, so we need to create a windows user account
for it in server B (usrMergeAgent). This windows user account needs read permissions
for the snapshot folder and db_owner permissions for the distributor and subscriber
databses. A SQL server login needs to be created in server A (for example, db_usrMergeAgent)
with db_owner permissions for the publication database.
&lt;/p&gt;
&lt;p&gt;
For this to work you have to create an user account in server B for the snapshot agent
(for example, usrSnapshotAgent). The snapshot agent needs write permissions for the
snapshot folder, and a windows login for SQL Server, with db_owner permissions for
the distribution database.
&lt;/p&gt;
&lt;p&gt;
Open a SSMC and connect to server B. Right click in the Replication-&amp;gt;Local Subscriptions
node in the Object Explorer and select New Subscription. Select the server A as the
publisher and the publication created in the previous step.
&lt;/p&gt;
&lt;p&gt;
Select pull subscription and the databse where the data will be replicated.
&lt;/p&gt;
&lt;p&gt;
The next wizard page is where you configure the security for the merge agent. Select
to run the merge agent under the windows account created previously (usrMergeAgent)
and choose to connect to the publisher, distributor and subscriber by impersonating
the process account. We'll connect to the publisher using a SQL Server login but in
this wizard we can't configure the publisher and distributor differently.
&lt;/p&gt;
&lt;p&gt;
The next step is to set up how often the merge agent synchronizes the data. This will
depend on your replication requirements.
&lt;/p&gt;
&lt;p&gt;
Finally, you have to specify if the subscription will be initialized automatically
and when (select yes and inmediately), and the type of subscription (server or client).
&lt;/p&gt;
&lt;p&gt;
If you view the synchronization status, the synchronization failed. This is because
we configured the merge agent to connect to the publisher impersonating the merge
agent account. If we modify the subscription options and change publisher connection
to use the db_usrMergeAgent.
&lt;/p&gt;
&lt;p&gt;
If you have done everything properly it should work. The error message:
&lt;/p&gt;
&lt;p&gt;
The merge process could not connect to the Publisher 'ServerA:publication'. Check
to ensure that the server is running.&amp;nbsp; 
&lt;/p&gt;
&lt;p&gt;
usually appears if there is an error with the permissions in the merge agent.
&lt;/p&gt;
&lt;p&gt;
As you can see there are a ton of steps to do and it is a very error prone process.
However this is not because it is a difficult concept. It is easy to understand all
the agents related to replication. However the number of accounts involved and all
the security permissions needed make it difficult.
&lt;/p&gt;
&lt;p&gt;
Once you have properly configured replication, it seems to work quite good. Anyway,
probably it is a good idea to configure Database mail to be notified of any error
in the replication process.&lt;br&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.manuelabadia.com/blog/aggbug.ashx?id=7228d85d-c0c4-4497-be63-1fa5edcf6fa3" /&gt;</description>
      <comments>http://www.manuelabadia.com/blog/CommentView,guid,7228d85d-c0c4-4497-be63-1fa5edcf6fa3.aspx</comments>
      <category>SQL Server</category>
    </item>
  </channel>
</rss>