.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

How to Audit Who Changed a SQL Job

Posted By:      Posted Date: October 04, 2010    Points: 0   Category :Sql Server

Hi, How can I track who makes changes to SQL jobs?   Is there an audit trigger to track SQL jobs?


View Complete Post

More Related Resource Links

Audit Trail


In my MySql Table I need to keep track of all the changes, especially create,update, and delete changes each record. I need to keep track of who did
what changes.

This is MySQL Create table Query

create table quotes(QuoteNumber int(15) ,Revision timestamp,Vendor varchar(45),
PartNumber varchar(60),Status varchar(20),Customer varchar(45),
Requestor varchar(20),X varchar(20),Xin varchar(10),Y varchar(20),Yin varchar(10),Layers Varchar(20),
BlindVia varchar(20),Impedence varchar(20))

How can i implement the Audit trail to above table.Please help me,Thanks.

Toolbox: Database Audit Logs, Joel on Software, Code Handouts, and More


This month the Toolbox column takes a look at database logging, Joel Spolsky's blog, printing code projects, and ASP.NET reading.

Scott Mitchell

MSDN Magazine May 2008

Stay Alert: Use Managed Code To Generate A Secure Audit Trail


In today's security-conscious environments, a reliable audit trail is a valuable forensic tool The Windows Server 2003 operating system provides features that let you enable a wide range of applications to make use of auditing functionality. This article looks at auditing from the operating system perspective and describes a sample managed code implementation that will allow you to add auditing to your own server applications.

Mark Novak

MSDN Magazine October 2005

Data Points: Creating Audit Tables, Invoking COM Objects, and More


Dealing with error handling between T-SQL and a calling application, evaluating when a field's value has changed, and creating auditing tables in SQL ServerT are all common issues that developers must tackle.

John Papa

MSDN Magazine April 2004

Setting size of Grid Since Ajax Resizer Changed It


I'm sure that wasn't a very good subject, but I couldn't think of a better one. What I have is a page that has an UpdatePanel on it with a GridView control in it. It was originally displaying at a particular height and width according to the CSS style I have setup for it in my style sheet. However, since adding an AJAX Resizer control to the UpdatePanel, it is now defaulting to a much smaller size.

How do I get the grid to default to that same height and width that is in its CSS class? I don't mind putting it in the ASPX page or whatever, just need the grid to default to a larger size than the small little box it defaults to since adding the AJAX resizer. 

output cache to be used only when parameter has changed + old question of user control not answered



i have 2 questions about output cache:

1.is it just me , or does it seems that it is used only after the second time that the user reaches the webpage? if so, why, and how can i tweak it to my needs? my guess is that it wouldn't be logical to cache every time a user reach a webpage, but only when it happens enough times.

2.i know that i can use "varybyparam" for using the output cache when the parameter doesn't change , but it seems that it would use the output cache even if there is no parameter , or if the specified paramter is not there. is there a way to overcome this?

3.an old question that somehow marked as "answered" , yet i didn't solve : suppose i created a user control and i gave it values through the CTOR via the aspx file . is it possible to show the values from within the split/design mode? remember that i've talking about ASP.NET and not simply C# winforms . i write this because this question was on :


and the answer that i got was for C# and winforms . i've tried to do the same for ASP.NET , but i've failed.

can anyone please help me?

Implementation of Audit Fields and optimistic concurrency

What is the best way to implement Optimistic concurrency? Also, I have 4 audit columns in every table in my database. They are created date, updated date, created by, updated by. Application should populate these fields. I want to know how to populate created date , and updated date? From where application datetime or database datetime? On save button click, if I have to save data into 4 different tables, then I need to have same datetime in all 4 audit fields correct? What is the best way to implement this? What will be the design? Please let me know.  

SQLCMD: supress "Changed database context to . . ."

Product:  2008 SQL Server Standard Edition. Shell:     SQLCMD (i.e. sqlcmd -i"test.sql")Script (test.sql):   use Master;   print $(SQLCMDERRORLEVEL)The screen output is always:   Changed database context to 'Master'   0However I want the above output to be (only):   0I have tried calling SQLCMD with the -m command line parameter set to each of the {-m-1, -m 0, -m 1} settings, but none work. I have tried: set SQLCMDERRORLEVEL = each of {-1,0,1,25), but none workAnybody know the secret?Thanks in advance,Jerry

SQLCMD: Changed Database Context messages

Is there a way to suppress the "Changed Database Context to " messages in SQLCMD?  For example, I get the following: 1> use master2> goChanged database context to 'master'.1>I am trying to migrate some legacy batch files that called isql and used the output files.  These extra "Changed Database Context to " messages are causing our scripts to break, and I was hoping to avoid having to write something extra to handle these messages.Thanks.

Generic Audit Trigger CLR C#(Works when the trigger is attached to any Table)

This Audit Trigger is Generic (i.e. non-"Table Specific") attach it to any tabel and it should work.  Be sure and create the 'Audit' table first though. The following code write audit entries to a Table called'Audit' with columns 'ActionType'    //varchar'TableName'    //varchar'PK'    //varchar'FieldName'    //varchar'OldValue'    //varchar'NewValue'    //varchar'ChangeDateTime'    //datetime'ChangeBy'    //varchar using System;using System.Data;using System.Data.SqlClient;using Microsoft.SqlServer.Server; public partial class Triggers{//A Generic Trigger for Insert, Update and Delete Actions on any Table[Microsoft.SqlServer.Server.SqlTrigger(Name = "AuditTrigger", Event = "FOR INSERT, UPDATE, DELETE")] public static void AuditTrigger(){SqlTriggerContext tcontext = SqlContext.TriggerContext; //Trigger Contextstring TName; //Where we store the Altered Table's Namestring User; //Where we will store the Database UsernameDataRow iRow; //DataRow to hold the inserted valuesDataRow dRow; //DataRow to how the deleted/overwritten valuesDataRow aRow; //Audit DataRow to build our Audit entry withstring PKString; //Will temporarily store the Primary Key Column Names and Values hereusing (SqlConnection conn = new SqlConnection("context connection=true"))//Our Connection{conn.Open();//Open the Connection//Build the AuditAdapter an

The subscription status of the object could not be changed

Good day to all.. I have a problem. There are two sql servers with transactional replication Microsoft SQL Server 2008 (SP1) - 10.0.2531.0 (X64) Mar 29 2009 10:11:52 Copyright (c) 1988-2008 Microsoft Corporation Enterprise Edition (64-bit) on Windows NT 5.2 <X64> (Build 3790: Service Pack 2) There was a table function without parameters, included in articles of publication. Then I had to change it with adding one parameter. I've changed it via alter function on the publisher. And then replication stopped with error message about invalid argument count in this function. I've decided to reinitialise subscribtion with new snapshot, but new snapshot can't be created ("The subscription status of the object could not be changed"). Then I've decided to drop this subscription and recreate it, but I can't drop it (same error - "The subscription status of the object could not be changed").. Dropping publication also was unsuccesfull. How I can repair replication now?

SQL Audit: What operations are captured within DATABASE_OBJECT_ACCESS_GROUP?

What operations are captured in DATABASE_OBJECT_ACCESS_GROUP? I expected create/drop certificate/symmetric key is captured. But nothing is captured after I followed these steps: CREATE DATABASE DB1, Configure and enable Server and Database Audit Specs which includes (only) DATABASE_OBJECT_ACCESS_GROUP (in both Specs). Then execute the following T-SQL Script.   USE DB1 GO CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'P@ssw0rd!' GO CREATE CERTIFICATE MyDBCert WITH SUBJECT = 'My Database Certificate' GO CREATE SYMMETRIC KEY MySymKey WITH ALGORITHM = TRIPLE_DES ENCRYPTION BY CERTIFICATE MyDBCert GO CREATE TABLE T1 (ID nvarchar(3), C1 nvarchar(50)) GO -------------------------------------------------------------- OPEN SYMMETRIC KEY MySymKey DECRYPTION BY CERTIFICATE MyDBCert DECLARE @I INT SET @I = 100 WHILE @I <> 0 BEGIN INSERT INTO T1(ID) VALUES(@I) SET @I = @I -1 END GO -------------------------------------------------------------- UPDATE T1 SET C1 = EncryptByKey(Key_GUID('MySymKey'),ID) OPEN SYMMETRIC KEY MySymKey DECRYPTION BY CERTIFICATE MyDBCert SELECT ID, C1, CONVERT(nvarchar, DECRYPTBYKEY(C1)) FROM T1 GO -------------------------------------------------------------- DROP TABLE T1 GO DROP SYMMETRIC KEY MySymKey GO DROP CERTIFICATE MyDBCert GO DROP MASTER KEY GO

User ID getting changed

Hi, Scenario - The site users has 2 User Id's with different domain. ie John has Id's Domain1\John and Domain2\John. Statement  - So whenever an user saves a User field in an item with Domain1\John, the item gets saved with Domain2\John, which is wrong. Other Info - (1)When the user saves an item, an eventhandler is fired for setting permissions for users and for initiating a workflow.(2) This issue does not happens in all User fields, it only occurs for those userfields(Approver Userfield) which are used in Workflow as an Approver. The other userfields works fine for all users.(3)This issue does not occur for all, but only for certain users. Please advise on why this problem is occurring. Thank You

WPF - Refreshing Datasource after collection changed

Hi All I have a a couple of business objects, a Market Position (like a holding in Microsoft say) and a Client Collection, which aside from a few other variables will hold in an ObservableCollection(Of FuturesSecurity) a collection of FuturesSecurities positions. Each Client is held in a ObservableCollection(Of Client) and I happily have many clients in this collection. Each Object (Client and FuturesSecurity) both implement INotifyPropertyChanged and I can trace changes in prices right up to the user interface level (proof of life been a msgbox called at that level), however I cannot get this to be reflected in my databinding. Is there a way I can get this to refresh automatically? Shouldnt that be happening with Databinding anyway when the datasource changes? I am currently setting the data source as:     Me.DataContext = Clients Does anyone have anythoughts here? Happy to post more code as neccersary thanks in advance Chris

Could not complete cursor operation because the table schema changed

Microsoft SQL Server  2000 - 8.00.2039 Got this error: Could not complete cursor operation because the table schema changed after the cursor was declared. SQLCode: 16943 SQLState: HY000 Is this a known issue?  I suspect the application logic may cause this error. Please advise. Thanks a lot!  

Infopath Changed Event code triggering in preview but not in web filler.

Hi there, I've written some code for a changed event hookup on a field in infopath 2010. The form is for submission to a sharepoint 2010 forms library. What the code does is fill in a specific value into a field depending on the selected value from a combo-box elsewhere on the form. When i preview this in Infopath 2010 it works perfectly but when i fill out the form through the web interface it simply does nothing. I've got another piece of code which executes on load and this works perfectly in both the preview and the web filler. What it does is just set the value of a field when the form loads. Here is the code, could someone tell me what i'm doing wrong? public void InternalStartup() { EventManager.XmlEvents["/my:myFields/my:service_level"].Changed += new XmlChangedEventHandler(service_level_Changed); EventManager.FormEvents.Loading += new LoadingEventHandler(FormEvents_Loading); } public void service_level_Changed(object sender, XmlEventArgs e) { // Write your code here to change the main data source. XPathNavigator xroot = MainDataSource.CreateNavigator(); XPathNavigator serviceLevel = xroot.SelectSingleNode("/my:myFields/my:service_level",NamespaceManager); XPathNavigator xest = xroot.SelectSingleNode("/my:myFields/my:est_cost", NamespaceManager); switch (serviceLevel.Value)

Using Windows 7 my screen resolution changed.

My screen resolution changed to 1280 X 720.The relavent sreen resolution section in windows only now allows me a max of the above.I am using NVIDIA Ge Force 9800GT graphics and ASUS VW220 monitor.Will appreciate any help.Cheers.    
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