What would be the best practice to follow to keep track of MS SQL
server changes... Stroed procs, tables, views, triggers, indexes, DTS
and also jobs ect....
I am not quite sure how Source safe works with sql server. Any other
way to do this... Even if its manual work, its okey.. I would
appreciate if any of the DBA's let me know how they are facing this
issue....
Hello there,Does anyone know of a way to track changes to an SQL Server database so thatI can easily run those changes at a later date?That is, I want to make schema changes, and record those changes so that Ican execute them 6 months later on a copy of the orignal database.Thank you kindly for any ideas anyone may haveJohn
Hi anyone please help! I have created the database driven web application with asp.net and sql server 2000. now I want keep track three operation(insert, updata and delete) that have been made on tables in a SQL Server 2000 database. what i did is: 1, create a audit table with columns: auditTable, actions, actionUser, actionTime 2, create three trigger(insert, update and delect respectivily) for every table my problem is that i can not get right user name. I use form authentication and i stored user login information in the database. every time, no matter who is logining to the web application, the action user is always SA. I user user-name() function to get userName(actionUser). Please anyone can help me to get current login user name, or tell the best way to track operations on a table. Thanks jili
I am trying to track unallocated space (because on my database growth is not kicking in) So using below query but not working!!! Is there any way I can track 'database size' and 'unallocated space' on a single database?
I am only DBA in my company and client want to know the growth rate of his SQL server DataBase which is in production. How can I get the growth rate per day?
I have a specific requirement. I need to insert the DML statements executed from Management Studio into a SQL table. We have SQL Server 2008 R2 and 2012 instances.
I would like to know about the DML process (Insert/update /delete) in a particular table .. it is like change tracking but I also want to know the modification date
I know CDC ( Change data capture ) but unfortunately it needs SQL 2008 developer/enterprise edition and my SQL server is SQL 2008 STANDARD edition.
hi, Is there a way to view any Transact sql in a log for instance, I am iserting a new records into a table. how can I track a log for the isert statment. I know that using bcp code provides me with a log if I use /o in the bcp code. Is there any similar thing for Transact sql thanks Ali
hello,I was wondering how to track all changes on tables by using some sort of ahistory table.What i would like is a generic history table where i can see who updated,inserted, deleted or executed(stored procedures, triggers) what value inwhat table with a date when it was occured.Could somebody help me with this?
A stored procedure has been executed either yesterday or today. I would like to find out which user and when they executed it. Is this possible without 3rd party transaction log interrogation tools?
While my application is running on the production server, I want to develop on the test server. After a few weeks, I want to update the application, and have to update the database structure on the production server also with the most recent one from the testserver, but without deleting the current data on the production server.
I create/modify all tables in SQL Server 2005 via Management Studio. The application is built in VS2008 Pro. I'm using SubVersion (SVN).
I can let Management Studio generate scripts for every change and store them manualy, but that's a little bit too much work. What I want is a sort off version control solution. A solution that a service running on the background tracks every change on a specific database on my test server, and stores them as T-SQL code in a repository. Then I can collect all those T-SQL scripts, and run them against the production server.
I want to create a page(using GridView) where it will detect changes made in the database and display it for Administrator observation. I've created a table name history for this purpose. History guid (uniqueidentifier) dateCreated(datetime) lastDateUpdated(datetime) changesMade(varchar(50)) ---- eg; dropdownlist oldValue(varchar(50)) ----- compaq newValue(varchar(50)) -----dell updateBy(varchar(10)) <------ username of registered user comNo(int) = foreign key for Computer table History data will insert data whenever a changes made. Could anyone advise and direct me how to do this function. I was thinking of using stored procedure to insert the data. Thanks in advance.
I have an application that has a SQL back end, and I want to be able to track who is accessing a record so that no one else can access it at the same time. I was going to do this with a table or application state, but how can I avoid keeping files locked when someone abandons a session? Any Ideas?
I have a stored procedure for which i need to track the changes. I wanted to know which user has updated the stored procedure and what all changes are done to it. I thought of getting these details from the transaction log, but looks like sql server 2000 doesnt have any log reader.
Hi all, I have a data of applicants. Everyday we dump this data into SQL server. Now I need to generate reports everyday so that we can track how many records get updated everyday. Now the thing is that the applicants are in various stages. So my reports need to track the how many applicants changed from stage "abc" to "pqr" and how many changed from "pqr" to "xyz". Now it is not necessary that all the records change stages everyday.
I need to be able to track which users and the number of times a user connects to a particular SQL Server database. I have a simple SQL Server database that users query (SELECT only) using an Access 2000 front-end. I do not have any control over the front-end so my only tools on the database side. I can't use 3rd party software, just SQL Server. Is there any way? Thanks.
I have a requirement. I am having a database which is having views,procedures and tables. Many users are having access to the database. If i want to track all the schema changes happening in the database how to achieve that? As in i have used some tables in a procedure and someone might change the column or drop the column. So it is going to have impacts on my procedure. I need a trigger which tracks all the changes done in a database and the impacts those changes are going to make.
Considering that sql server Update is a chained Delete and Insert, the first row is the delete row capture and the second one is the insert row capture.
But I don't understand why the address is tracked as NULL when I update other fields.
I have a strong feeling that this isn't possible but I thought I might as well ask...
I'm developing a database application (SQL Server 2000 backend) where the client and the server is separated over a slow network connection (satellite). There are parts in the application where I will have to query a large resultset so I was wondering if there is a way to determine the percent complete of a query so I can put a progress bar on the interface so the user can see it loading data instead of having a frozen form.
I thought about spliting up the query into different ones and update the bar once each separate one is complete but I'd rather not do that because in the application development environment I'm working in, I have to close the resultset and reopen it every time I do a query... unless this isn't a big deal but I'm under the impression its something to avoid.
different Users are running select statements under their own login. they have readonly permission to the database. My goal is to track all those queries and send notification which tables were opened and which columns were displayed...Looks like I need trigger on select statement for the table...( Unfortunetely it doesn't exists) I collect all those statements in trace file and in the night time I stop trace, move file data to table and then step by step try to massage sql queries using VB.net... Most of those queries are so complicated, have derived tables inside and it is really hard to parse these sql statements... 1.If anybody has an idea how to say: User B opened table tbl_A col_B twice per today...using different methodology rather then go through SQL.(Other words how to create an event on a table which will be fired in a case of request select any column of that table?) 2.If somebody know where we can take good parser which will help with this job? Thanks
I am an advanced user of MS Access and other databases but relatively new to SQL Server. I am utilizing SQL Server Express to analyze a database that was created by another entity. I am interested in looking at any specific record in any table and seeing who created that record, what date/time the record was created, who edited the record, when that edit occurred, etc. I don't see any such fields in the database. Would the designer of the database have to have explicitly added such functionality, or is this information available but just hidden from the novice's view?
We're using SQL Server 2000 and we'd like to be able to track our viewusage to tell which of our views get used most often. This will helpus determine which views we need to concentrate on first foroptimizing, indexing, etc... Does anybody know if there's a way totell when a view is opened?Thanks,Gary
I have a problem concerning keeping track of a value within a query. I have a table that tracks invoices recieved and payments made. For each invoice number there may be multiple payments made against it. I need something that will check and make sure that each invoice number has its payments equal to its received amount.
Is there any method to track stored procedure changes?
Basically I want to save a copy of stored procedure definition in my own table whenever a stored procedure is being created/updated/dropped from the database.
Thanks.
P/S: Table to keep the copy
CREATE TABLE USP_HISTORY(
UserID nvarchar(128),
ActionType varchar(10),
ActionDate datetime,
SPName nvarchar(128),
Definition nvarchar(MAX)
)
ActionType stores value like Create or Alter or Drop
I have a large "view" I'm working with, between 250-280 fields [not sure exactly]. Within this view there are a few fields with similar information. For example, LocationID corresponds to the Address, City, and State, but those three are seperate fields.
I also have a field with the most recent date and time that the address was used. There can be multiple records for any address if the address was used more than once in any given month.
What I need to do is pull each distinct address-if there is more than one instance of that address, the instance that was most recently touched, along with all the other 200+ corresponding fields.
I started off thinking I could sort the address ascending, and then the time descending, and just pull the first hit of each address by using the DISTINCT keyword in my query, but it keeps getting thrown off by all of the fields, and ends up not being distinct.
I was using something like this:
SELECT DISTINCT Address, BUnit, ResultDateTime
FROM dbo.vw_ReportData
WHERE BUnit='Blah'
ORDER BY Address, ResultDateTime DESC
Can anyone shed some light on this issue? That where statement needs to be in there [or its effect anyhow]. Any help would be appreciated.