.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

Fixed Agent Roles acting different after restore of MSDB

Posted By:      Posted Date: September 14, 2010    Points: 0   Category :Sql Server
SQL Server 2008 v. 10.0.2531 We recently had to expand the C: drive on one of our servers. So we re-installed SQL Server after the expansion & then we just attached all of our user databases, re-mapped logins, & restored the MSDB backup from the old installation. Everything went well but I'm seeing some weird behavior with regards to the Fixed Agent Roles. A user that was a member of all three roles was getting an error when trying to run a job. The error was: User does not have access to   xp_sqlagent_is_starting in mssqlresource please grant execute and xp_sqlagent_notify in mssqlresource please grant execute   I was able to get around it by adding the user to the master DB with public access & granting them execute on these two extended procs but I would really like to know what happened here. It seems those roles should have access to those procs by default if they are needed to perform the tasks they were intended to perfom. Any idea what I may have done wrong here?

View Complete Post

More Related Resource Links

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

how to restore msdb database on sql 2008 from sql 2005 backup?

Currently, I am unable to do it. It gives me the error than I cannot be restored because it was created by a different version of the server. What is the work-around? I hate scripting all my maintenance plans and alerts, there are tonns of themJulieShop

SQL Agent Roles and the Ability of an AD Group to Execute Jobs

I would like to give an AD group the ability to execute Agent Jobs using the 2005 Agent roles (SQLAgentUserRole, etc) but you can not assign ownership of a job to a group. I have seen some work arounds and the only one I am considering is using a proxy account. Does anyone have any insight on doing this? This is certainly a fairly common thing to do, give support technicians the ability to run a job.  Running sql server 2005 standard ed, sp3 on a windows server 2003 standard r2 ed, thanks

ASP.NET forms authentication with roles

.A timeout is specified in minutes. This is "time since last request" not the "time since login". If a login is indicated to be persistent (described later) this is ignored.
.A protection method is specified for the cookie.
Next I wanted to specify a folder to which access is restricted to people who have logged in. To do this I entered the following code in the web.config file (beneath

SQL Server Backup and Restore (video)

Restore your full backup, then run a few queries before you keep restoring transaction logs. Brent shows how to use the Standby option for restores.

In this five minute video, Brent demonstrates how to do it by creating a database, populating data, and then showing what disaster recovery is like by doing RESTORE WITH STANDBY.

How to Fixed GridViews Header and Footer when scrolling in asp.net?

This article is to show you how to Fix GridView''s Header and Footer in a simple code with CSS and JavaScript

Scrollable GridView with fixed headers in asp.net C# vb.net

In this example i am going to show how to create scrollable GridView with fixed headers which don''t get scrolled with records and stay on the top in asp.net using css, I''ve tested this code on IE7 and Firefox 2.0 , 3.5.

For this we need to add css to headers of gridview to keep them on the top.

First of all place a Panel on the aspx page from thetoolbox. Set height to 200px and width to 200px
and scrollbars to Vertical.
Now add a gridview inside this Panel and set the datasource to populate gridview.

Hard Code Roles on the Pages


If i hard coded role=Manager on the specific SiteMap/Folder/Page/etc. I will have problem when the manager need to remove from access a specific page. I need to change the code ont eh page/SiteMap/Folder more move the file into another folder.

What i have in mind is to change the role to taks oriented. such as role=AddStock, Edit Stock, Delete Stock, Print DO, Add Sales, Edit Sales, Deleted Sales..... (but it will be many role for 1 user compare to just 1 as Manager)

Will this cause performance issues later when each user have 60 roles and if i have 20,000 user will it affect the application performance?

Otherwise any other option? to make it flexible.

How in web.config work in MVC



I would like to secure any URL below the http://MyServer/Admins and limit it to a specific role.

In webforms it was straight forward. I just put a child web.config in the /Admin/ folder and add <authorization>  <allow roles> tags to it.

How would be the equivalent technique in MVC?

Thank you,


Roles not updating


I have all my code in my other post about checkboxlist issue, but it boils down to, once i find someone doing my search, it displays their permissions as checkboxes. But if i want to remove a permission and click update, the update doesnt seem to occur, if i search on myself, it returns me with my permissions already checked. I uncheck 1 permission, click update and the checkbox is checked again as the page posts.

Original Post:

My aspx page seems pretty simple:

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div>Enter UserName: 
        <asp:TextBox ID="TxtUserName" runat="server" /><asp:Button ID="LookupBtn" runat="server" Text="Search" onclick="LookupBtn_Click" />  
    <div class="roleList">
        <asp:CheckBoxList ID="RoleList" runat="server" /><br />
        <asp:button ID="UpdateBtn" text="Update" Visible="false" runat="server" onclick="UpdateBtn_Click" />

My update button event and update method:

Trying to get Roles to populate a checkboxlist based on tutorial and having issues.


I have been using the following tutorial and had to convert the code to C# for my project, now i cant get the code to work, im getting red line under the word "in" in the UpdateRolesFromList,
i tried to add a datasource on page load for the checkboxlist like so RoleList.DataSource = PopulateRoleList(User.Identity.Name.ToString());

and gives me error saying cannot implictly convert type 'void' to 'object'


What am i missing, that when i load the page or even do a search it never displays the checkbox list as it shows in the tutorial?

        protected void Page_Load(object sender, EventArgs e)

        public void PopulateRoleList(string userName)
            string[] roleNames = null;
            string roleName = null;
            roleNames = Roles.GetAllRoles();
            foreach (string roleName_loopVariable in roleNames)
                roleName = r

How to stop the repeated database queries for roles


Hello, friends,

We have a web application using VS 2008, c#. We try to filter siteMap nodes based on security roles. We have our customized the mether GetRolesForUser() in RoleProvider class to determine a user's role. In this method, roles will be returned by querying an SQL Server database.

However, we found that each time a page was loaded/refershed, this  GetRolesForUser() was called, and the database would be queried. This is too MUCH and expensive.

We thought the roles should be queried only once when a user logs in. After that, role info should be stored somewhere for this user, rather than query DB all the time.

Any ideas, reference paper, snipet,...,?

Thanks a lot!

getting a email delivert status when sending email using msdb.dbo.sp_send_dbmail


Hi All,

Can some help me regarding following.

I have set a job in sql server 2008 to send reminder emails for product expiration.
Now I want a report which will specify the list of the emails sent with the email status details like queued ,sent,delivered, failed.

I can fetch the emails that are sent by querying the like following

select * from sysmail_mailitems SM inner join sysmail_profile SP on SM.Profile_Id = SP.Profile_Id
and SP.Name ='ReminderProfile'

The problem is only getting a perfect status of email whether it is delived or failed. How I can get those status ?
Please help.


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

Adding user to certain roles


I have setup ASP security in my application. I used the following tutorial, just wondering if someone can tell me how i can setup this up to allow the creation of a user?


Can someone tell me where to find or what to search on to find some example of how to add the option for adding users?

I have the above setup and its working, but only because of the accounts i created with my global.asax file.
I need to give the admins access to add a new user. Currently i can search on existing users and update them, but need to add the ability to add a new user.

Using Checkbox and MultiSelect for Roles


I am new to MVC and am using MVCContrib and trying to use the Checkboxlist .My requirement is to display list of all available roles on create user page . I have dine as below .

<%=this.CheckBoxList("Roles").Label("Roles:").Options(new MultiSelectList(Roles.GetAllRoles(),"DataTextField","DataValueField"))%>

In this case GetAllRoles method retuns string[] . How can I assign the "DataTextField","DataValueField" to make it work ?

Thanks in advance.

Accessing Username, password, roles in xml file


Currently I am storing my username and password (passwordFormat="SHA1") credientails in my web.config.  I would like to figure out how to access them in an xml file that I have stored in my App_Data directory rather than the web.config file because I do not want my application restarting everytime I manually add a user (small list of 5 authorized users for the CMS section).

Here is what my web.config section looks like:


<authentication mode="Forms">
      <forms name=".Administration"

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