Help!!! This is really frustrating me down!
I was trying to follow the MS official tutorial "Creating a mobile application with SQL server mobile" could be found in this link
http://msdn2.microsoft.com/en-us/library/ms171908.aspx
In the step of creating a merge publication, as I noticed, the snapshot agent is started sucessfully. But very soon later (few seconds), it was shut down with an error message. I checked in the error history, the following message I found:
"... The replication agent encountered a failure. The step failed"
I also went to msdb.dbo.sysjobsteps and found "Detected nonlogged agent shutdown".
Anyone could help

Problem with creating a merge publication
Lou Searles
Thanks for your help. I ran the snapshot.exe at command line. A black and blank console windows appeared for a second and then dissapear. I then went to run the agent again, still get the same error message.
By the way, the following messages I got from the msdb.dbo.sysjobsteps
Snapshot Agent startup message.
sp_MSadd_snapshot_history @perfmon_increment = 0, @agent_id = 7, @runstatus = 1, @comments = 'Starting agent.'
Run agent.
-Publisher [BSNB4\BSNB4_2005] -PublisherDB [SQLMobile] -Distributor [BSNB4\BSNB4_2005] -Publication [SQLMobile] -ReplicationType 2 -DistributorSecurityMode 1
Detect nonlogged agent shutdown.
sp_MSdetect_nonlogged_shutdown @subsystem = 'Snapshot', @agent_id = 7
Mojo2000
Hi
I had the same problems with generating a snapshot. Changing the database roles of the snapshot user to dbo in the db you want to create a snapshot brought me to success!
Hopefully I could help you.
best regards
ender080
The Snapshot Agent records history in a table in the distribution database for this Publisher. (The distribution database is usually located on the Publisher, unless you configured the Publisher to use a remote Distributor.) The status messages of the Snapshot Agent are not available in the job history; you have to look at replication history.
There are several ways in Management Studio to see the last message from the Snapshot Agent:
1) Look at the Snapshot Agent Status dialog box. In Object Explorer, right click on the publication, and click Snapshot Agent Status. The dialog box that displays will have the last history message from the Snapshot Agent, which should be the error message in this case.
2) Look in Replication Monitor. In Object Explorer, right click on the publication, and click Launch Replication Monitor. In Replication Monitor, expand the Publisher in the Navigation Pane on the left side, and then select the publication. In the Detail Pane on the right side of the window, click the Warnings and Common Agents tab. At the bottom of the tab you will see a grid that contains a row for the Snapshot Agent. Double-click that row, and Replication Monitor opens a window that gives all of the history messages from all runs of the Snapshot Agent. You can browse this information to see full error messages from the agent.
Phil Garding
Senior Program Manager
Microsoft SQL Server Replication Management Tools
Flavelle Ballem
Hello i have the same problem with this example and although my agent user is a dbo of the database i can't get it to run
I follow the instructions above and i get this
2006-02-15 10:15:15.92
2006-02-15 10:15:15.92 Microsoft (R) SQL Server Snapshot Agent
2006-02-15 10:15:15.92 [Assembly Version = 9.0.242.0, File Version = 9.00.1399.00]
2006-02-15 10:15:15.92 Copyright (C) 1988-2005 Microsoft Corporation. All rights reserved.
2006-02-15 10:15:15.93 The timestamps prepended to the output lines are expressed in terms of UTC time.
2006-02-15 10:15:15.93 User-specified agent parameter values:
2006-02-15 10:15:15.93 --------------------------------------
2006-02-15 10:15:15.93 -Output c:\Error.txt
2006-02-15 10:15:15.93 --------------------------------------
2006-02-15 10:15:15.93 The replication agent had encountered an exception.
2006-02-15 10:15:15.93 Source: Replication
2006-02-15 10:15:15.93 Exception Type: Microsoft.SqlServer.Replication.ReplicationAgentException
2006-02-15 10:15:15.93 Exception Message: The required agent parameter 'Publication' was left unspecified.
2006-02-15 10:15:15.93 Message Code: 52008
2006-02-15 10:15:15.93
can anyone Please tell me what must I do
Thanks
Savvas
wierdo
Add this parameter when you run it from the command line: -Output "c:\somefile.txt". This will log the agent output to whatever file name you specify.
Youngmin
can you try to run the snapshot.exe from the command line to see what you get if you still only see a very short error message, you can specify the -outputverboselevel to 2 to give you more info for what could be wrong. You can get the command line by selecting from the msdb..sysjobsteps table.
Thanks
Yunwen