.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

change snapshot agent user (Agent security)

Posted By:      Posted Date: September 07, 2010    Points: 0   Category :Sql Server
Hi, we have replicated dbon sql server 2008 (transaction replication) now we want to change the user used for the snapshot agent, from sql Managment studio go to publication property and then agent security and then snapshot agent (now we are using domain user) here we want to use the other option which is " to be run under sql server agent service account" but I couldnt choose this option because its unactive so how we can activate this option for existing replication without restarting the replication (i can use this option for the new replication wizard) Thanks

View Complete Post

More Related Resource Links

Transactional Publication With Article Using DATE Datatype Causes Snapshot Agent to Fail with Error

So I am using SQL Server 2008 Enterprise Edition (64Bit) and have run into a strange problem that is baffling me. I have two tables that I need to replicate.  They are identical in specification except the name (one is for monthly stats and one daily stats) CREATE TABLE [dbo].[statsDailyLite]( [EntryDate] [date] NOT NULL, [SetID] [int] NOT NULL, [ProductID] [smallint] NOT NULL, [Hooks] [int] NOT NULL, [AdViews] [int] NOT NULL, [Clicks] [int] NOT NULL, [UAdViews] [int] NOT NULL, CONSTRAINT [PK_statsDailyLite] PRIMARY KEY CLUSTERED ( [EntryDate] ASC, [SetID] ASC, [ProductID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ) GO CREATE TABLE [dbo].[statsMonthlyLite]( [EntryMonth] [date] NOT NULL, [SetID] [int] NOT NULL, [ProductID] [smallint] NOT NULL, [Hooks] [int] NOT NULL, [AdViews] [int] NOT NULL, [Clicks] [int] NOT NULL, [UAdViews] [int] NOT NULL, CONSTRAINT [PK_statsMonthlyLite] PRIMARY KEY CLUSTERED ( [EntryMonth] ASC, [SetID] ASC, [ProductID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ) GO They both conatin a thousand or so test rows of data, and they are both in a transactional publication going to another SQL 2008 box. Now when the tables are empty

Unable to validate data in User Agent: Mozilla

Hi All,Thank you for advance.Error Details : User Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows XP)Message: Unable to validate data.Source: System.WebTargetSite: Byte[] GetDecodedData(Byte[], Byte[], Int32, Int32, Int32 ByRef)StackTrace:    at System.Web.Configuration.MachineKeySection.GetDecodedData(Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Int32& dataLength)   at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString)OS Environment : Microsoft Windows Server 2003 Statandard x64 Edition and Service back 1Application Environment : Asp.net 2.0/C#We have lot aspx files but we are getting this error in register and login page only.I added the machineKey in web.config file reference with codeproject article (http://www.codeproject.com/Articles/43637/Weird-Error-Unable-to-Validate-Data-in-ASP-NET-web.aspx)but still i am getting the error.

User proc must start Agent job -- how?

My app must allow users to start a SQL Agent job to do a background operation.  I found a discussion on this and attempted to implement the last solution therein:
use [MyDB];

create PROCEDURE dbo.spStartAgentJob
	@pvJobName	nvarchar(100)
	WITH EXECUTE AS 'agentProxy'
EXEC msdb.dbo.sp_start_job @pvJobName

create certificate agentProxy 
    ENCRYPTION BY PASSWORD = 'pGFD4bb925DGvbd2439587y'
    with subject = 'agentProxy'
   , expiry_date='01/01/2100';

      BY CERTIFICATE [agentProxy]
        WITH PASSWORD = 'pGFD4bb925DGvbd2439587y';

alter certificate [agentProxy] 
  remove private key;

backup certificate [agentProxy] 
 to file='c:\temp\agentProxy.cer';

use msdb

create certificate [agentProxy] 
  from file='c:\temp\agentProxy.cer';

create user [agentProxyAuthenticator] 
 from certificate [agentProxy];

grant authenticate to [agentProxyAuthenticator];
grant execute on msdb.dbo.sp_start_job to [agentProxyAuthenticator];

use [MyDB];

exec dbo.spStartAgentJob N'test'
The EXECUTE permission was denied on the object 'sp_start_job', database 'msdb', schema 'dbo'.

Did I miss something?  What is the correct way to accompli

SQL 2008. Merge replication. Snapshot agent. Access Denied

Windows Server 2008 Standard x64 SP1, SQL Server 2008 Enterprise Edition x64 SP1
Snapshot agent has read-write permissions to ReplData folder but cannot access local snapshot folder. How to resolve this error?

Error messages:
Source: mscorlib
Target Site: Void WinIOError(Int32, System.String)
Message: Access to the path 'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\ReplData\unc\ServerName_DatabaseName_PublicationName\DateTime\' is denied.
Stack:    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, DirectorySecurity dirSecurity)
   at System.IO.Directory.CreateDirectory(String path, DirectorySecurity directorySecurity)
   at Microsoft.SqlServer.Replication.Utilities.CreateDirectoryWithExtendedErrorInformation(String directory)
   at Microsoft.SqlServer.Replication.Snapshot.SnapshotProvider.CreateSnapshotFolders()
   at Microsoft.SqlServer.Replication.Snapshot.MergeSnapshotProvider.CreateSnapshotFolders()
   at Microsoft.SqlServer.Replication.Snapshot.SqlServerSnapshotProvider.GenerateSnapshot()
   at Microsoft.SqlServer.Replication.SnapshotGenerationAgent.InternalRun()
   at Microsoft.SqlServer.Replication.AgentCore.Run() (Source: mscorlib, Error number: 0)
Get help: http

How to know a Snapshot or Synchronization Agent is Running ?


Dear Sir,

In my application, I want to restrict some options when Snapshot agent or Synchronization agent is running.

So is there any way I can know that Snapshot or Synchronization agent is running ?

Sanjay Shah

Snapshot Agent timeout issue


I created a new Merge publication but when I tried to create a snapshot, SQL Server Snapshot Agent time out after about 30 mins.

sys.sp_MSsetup_partition_groups run a long long  time.

There is no dynamic filter like based on Hostname.

snapshot_read column = 0.

Any suggestion?  thanks in advance.


Error messages:
Message: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
Command Text: sp_MSsetup_partition_groups
Parameters:     @publication = HighPrairie3

Stack:    at Microsoft.SqlServer.Replication.AgentCore.ReMapSqlException(SqlException e, SqlCommand command)
   at Microsoft.SqlServer.Replication.AgentCore.AgentExecuteNonQuery(SqlCommand command, Int32 queryTimeout)
   at Microsoft.SqlServer.Replication.AgentCore.ExecuteDiscardResults(CommandSetupDelegate commandSetupDelegate, Int32 queryTimeout)
   at Microsoft.SqlServer.Replication.Snapshot.MergeSnapshotProvider.SetupPartitionGroups()
   at Microsoft.SqlServer.Replication.Snapshot.MergeSnapshotProvider.DoRegularMergeSnapshotPrep

Give non-sysadmin user access to SQL Agent Jobs


Hi, I have a situation where a group of users (domain ad group) need access to create and edit SQL Agent Jobs. The group can not be sys admin. I tried with the server role SQLAgentOperatorRole. but that doesn't give access to edit all SQL Agent Jobs, only the one that the users owns.

Thanks in advance

dynamically change html code when user is authenticated


So I have a fairly simple web site which allows an Administrator to edit some data in a database which is displayed on some web pages.

The main navigation on the site is shown in the code snippet below. The Admin link goes to a Login.aspx which allows the Administrator to log in - once authenticated they get sent to the data edit page.

So my question is, how could I dynamically add a link to the data edit page in the <ul> list below once the user is authenticated ?

This would allow the authenticated user to see links to the secure pages in the main navigation bar.

<%--Top Navigation Menu --%>
<div id="topMenu">
<li><a href="default.aspx">Home</a></li>
<li><a href="introduction.aspx">Introduction</a></li>
<li><a href="curriculum.aspx">Curriculum</a></li>
<li><a href="times.aspx">Times & Fees</a></li>
<li><a href="staff.aspx">Staff</a></li>
<li><a href="login.aspx">Admin</a></li>
</div><%--End of topMenu Container--%>
<div id="clear"></div><%--Floats items cleared End of Master Page--%>

sql server agent - job schedule 22022 error


Hi ! I have scheduled a job in sql server 2008 to send birthday e-mails. I run the script and it looks wroking but in agent schedule it doesn't. I am getting the below error; what is the problem?

TITLE: Microsoft.SqlServer.Smo
Start failed for Job 'Sending_transferdb_birthdate_e-mails'. 
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1447.4+((KJ_RTM).100213-0103+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Start+Job&Link

stsadm Import command + include user security



When I move sites from test to staging to production, I am using the stsadm –o export command with the –includeusersecurity option in the staging environment.  In production environment, I then use the stsadm –o import command with the –includeusersecurity option.  I was assuming that this option was bringing over the security on the exported site only.  This does not seem to be the case.

Last night I exported one sub site to produtction.  Today, I was notified that the security groups on other sub sites have been altered.  


So why is it when using the –includeusersecurity option effect all sub sites and not just the one sub site being moved from staging to production

[Sharepoint 2007] How can i change the email of a sharepoint user ?

Hi all,

I have created a new sharepoint user.

1. First of all i have added a new user in active directory. However at that time i forgot to give an email address. Big mistake !

I cannot send mail from sharepoint workflow with the new user.

2. Therefore I updated the email addresd in active directory afterwards. But the change was not reflected in sharepoint.

I updated the mail in sharepoint adminsitrative user profile. But it did not make no difference in the user moss profile.

I followed the article in http://sharepointnotes.wordpress.com/2008/05/05/syncing-wss-and-moss-user-profile-properties-with-active-directory/

I did the following commands :

1. stsadm -o sync
2. stsadm -o sync -synctiming m:2
3. stsadm -o sync -deleteolddatabases 6
 stsadm -o sync

None of these commands updated the user properties mail for my new MOSS User.

I also rebooted the machine but my MOSS user email was not updated.

Also I used the tool at http://userprofilesync.codeplex.com/releases/view/13227
like the following :

tool>UserProfileSync.exe -url http://mysite -ssp http://mysite:37239/ssp/admin
I did not make any difference

What else can I try in order to update the email of my MOSS user ?

How to change The DateTime Automatically according to User TimeZone Offset?

I have an application in which we are displaying DateTime in many pages. we want to display these DateTime's according to UserTime zone. UserTimeZone will be in database. All DateTime values will be saved int UTC format. My Requirement is I want set the TimeZoneOffset of user in ServerSide based on the User TimeZoneOffset All the DateTime values needs to be Added/Substracted while showing the DateTime values to user. I dont want to manully add/substract TimeZoneOffset value in all pages. Is there any way the DateTime  automatically change to the User Timezone.  How can I do this? Thanks in Advance ChellamNaidu

Error while executing a package through SQL Server Agent

Hi All,   I have a ssis package. It has 3 tasks, first task updates a record in Oracle database to set an Indicator to “Y”, second task process SSAS Cube and the third again updates the same record and sets the indicator to “N”. This package has 2 data sources, one is Oracle and the other is Analysis Services. I gave the credentials for the Oracle and use NT Authority for Analysis services.   When I am executing from BIDS package is executing successfully. But when I am calling the job to execute this package its throwing me the error. Below is the error.     Message Executed as user: User\Username. ...ion 9.00.4035.00 for 64-bit  Copyright (C) Microsoft Corp 1984-2005. All rights reserved.    Started:  10:57:46 AM  Error: 2010-08-27 10:57:46.79     Code: 0xC0016016     Source:       Description: Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B "Key not valid for use in specified state.". You may not be authorized to access this information. This error occurs when there is a cryptographic error. Verify that the correct key is available.  End Error  Error: 2010-08-27 10:57:47.16     Code: 0xC0202009     Source: Ord_test Connection manager &q

sql server agent roles and permissions

hi does any one have idea of what kind of roles are needed for creating a SQL server agent job and why those roles are needed?? Please Reply ASAP Because i don't have sysadmin rights.........so that other developers can use the same login for creating the jobs Thanks in advance

Staying with the SQL Agent during Execution

I need to create a stored procedure that triggers off a particular job in the SQL server 2005 agent, waits for the job to complete and then returns back the control to the calling application with the job execution results. As far as triggering off the SQl server agent is concerned, I can use the sp_start_job procedure. But what is the best way to wait for the job to complete execution (Because the sp_start_job proc returns back the control immediately after starting the job). I could use the sp_help_job proc in a loop and wait for the value of the "current_execution_status" column to change from 1 to 4...but is there a better way of doing this? Appreciate inputs here. - Thanks, Manmeet

Error starting SQL Server Agent - Could not load the DLL xpstar90.dll. Reason: 126

AD Service account password was changed.  Now the SQL Server Agent (MSSQLSERVER) will not start even after updating the password.  Have no access into the databases.  Log files say "Could not load the DLL xpstar90.dll, or one of the DLLs it references. Reason: 126(The specified module could not be found.)."  Service Account has Full rights on system.  Any help in solving the problem would be great.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend