getting trace of changes in database

Hello there. I've build database trigger who saves all schema changes in 
some table. and i use it to apply changes in another server.

It works fine as long as i do only shcma changes as part of schema and not 
another actions that relate to schema changes like: sp_rename, (Insert, 
update, delete) on table as part of schema change.

is there a way to add also these changes to the table who save schema 
changes automaticlly? 


0
Roy
9/12/2010 10:47:49 AM
sqlserver.programming 1873 articles. 0 followers. Follow

1 Replies
847 Views

Similar Articles

[PageSpeed] 53

Roy Goldhammer (royg@yahoo.com) writes:
> Hello there. I've build database trigger who saves all schema changes in 
> some table. and i use it to apply changes in another server.
> 
> It works fine as long as i do only shcma changes as part of schema and not 
> another actions that relate to schema changes like: sp_rename, (Insert, 
> update, delete) on table as part of schema change.
> 
> is there a way to add also these changes to the table who save schema 
> changes automaticlly? 
 
If you have tables with predefined data, so that INSERT, UPDATE and DELETE
are logically the same as DLL, you could set up triggers on these tables. 
But you would need to find a way to avoid that these triggers are not 
installed on that other server. And since you cannot capture the very 
statement, you would need to store the changes in some other way.

When it comes to sp_rename, this is difficult in SQL 2005. Have a trace 
running to pick up sp_rename is a possibility, but I would not
consider it practical.

In SQL 2008 this is different, as sp_renamed are trapped by DDL triggers. 
(There are a still few system procedures that are not, but they are minor
issues. I think sp_autostats is the most important of these.)

A completely different option is to invest in a tool like SQL Compare
from Red Gate that compares two databases on schema level. They also
have SQL Data Compare to do the same on data.

-- 
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

0
Erland
9/12/2010 12:01:05 PM
Reply:

Similar Artilces:

i get error 404 not found when trying to download
I'm trying to download nokia pc suite to windows xp to upload gallery onto the computer but get error message404 not found - how can i download this pc suite please -- Krysy Albutt Krysy Albutt wrote: > I'm trying to download nokia pc suite to windows xp to upload gallery > onto the computer but get error message404 not found - how can i > download this pc suite please Care to enlighten us how this pertains to: - 1) Microsoft 2) Publisher 3) Windows If you're having problems downloading from the *NOKIA* site where do you think you should be directing your ...

How to change Static Text property in a function?
I want to change Background(forground) Color of a Static Text control in member function. How to do that? sxy7711 wrote: > I want to change Background(forground) Color of a Static Text control in > member function. How to do that? > > See the example in the doc page for OnCtlColor. -- Scott McPhillips [VC++ MVP] ...

compact database at run time
hi How can i compact my access database programmatically .. In MSDN they gave a code like #import "C:\PROGRAM FILES\COMMON FILES\System\ado\Msado15.DLL" #import "C:\PROGRAM FILES\COMMON FILES\System\ado\MSJRO.DLL" no_namespace try { IJetEnginePtr jet(__uuidof(JetEngine)); jet->CompactDatabase( "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\\nwind2.mdb", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\\abbc.mdb;" \ "Jet OLEDB:Engine Type=4"); } catch(_com_error &e) { ::MessageBox(NULL, (LPCTSTR)e.De...

How to get Calendar to send me reminders
I have changed my e-mail address but for some reason I cannot get Calendar to send reminders to my new address - I think I have carried out all that is necessary to effect the changover but I am not getting reminders sent. Can anyone help please? Is the Calendar Live ID based and accessible at Calendar.live.com ? -- ....winston ms-mvp mail "Dabardevon" wrote in message = news:FDC2B3B2-EDE4-41B1-BFC4-C0F9ED59CFB9@microsoft.com... I have changed my e-mail address but for some reason I cannot get = Calendar to send reminders to my new address - I think I have...

Some recipients get the attachment, some get winmail.dat
This one has me baffled. We are using Exchange 2000 and Outlook 2000 and have been for 8 months. No previous problems with attachments (.doc, .xls, .jpg). About 2 weeks ago, we started hearing from certain recipients that the attachment wasn't arriving; instead they were getting an unreadable file called winmail.dat. MS says that this is because the sender is using Rich Text to format the email. We have changed the senders to use Plain Text and still have the same problem. If the email is sent to several recipients, some will get the attachment fine, some will not. This didn'...

How to get the CScrollBar's Handle in CTreeCtrl?
Hey,All: I thought I have a problem when I trid to get the CScrollBar's handle from my CTreeCtrl extended handle. Can anybody tell me whether I can get the handle of the CScrollBar from the CTreeCtrl? Thanks in advance! Carl :-| Carl wrote: > Hey,All: > > I thought I have a problem when I trid to get the CScrollBar's handle from > my CTreeCtrl extended handle. > Can anybody tell me whether I can get the handle of the CScrollBar from the > CTreeCtrl? > > Thanks in advance! > Carl > :-| > > Sorry, it is not that simple. The scroll bars that...

A Crystal Beginner
I am using Crystal 9.2.4.77 and have loaded the Crystal enhancements. Now I want to do against the CRM database. What do I do? I thought I would create a data source to the CRM SQLserver, which I did, then connect to it through Crystal Reports. That works, but when I drill down on the AAA_MSCRM database to choose my tables, it shows me dbo as the only option (where did this come from??) and under that are just a few generic tables. No CRM tables. Something's not quite right. What am I missing? file - log on to aps server "KBLawson" <klawson@aetinc.com> wrote in ...

Cannot get fast forward or fast reverse to work with WMP 11
I am running Vista Home Premium on a HP G 217-EM Notebook which comes pre-installed with Windows Media Player 11. When I play cds and try to fast forward or fast reverse by keeping the fast forward or fast reverse buttons constantly depressed nothing happens. Why is this, and can anyone come up with a solution? Many thanks This doesn't work on my system either, so it's probably just a limitation of WMP. Fast forward and fast reverse should work fine when you rip the CD's to MP3 or WMA files, and play these files instead. Regards -- Tim De Baets http://www....

Get paid while you get online!!
I found a great Internet company - Cashfiesta.com - that has created a product everyone can benefit from. They pay you while you work or play on your computer. All you need to do is keep their software - the FiestaBar=99 - active while you are online. They even pay you when your friends are using their computers. Unlike other companies, Cashfiesta gives you control over how much money you earn. They have an individual payrate based on the number of Special Offers you sign up for. As some of these offers are free, you can increase your payrate up to 33 times without spending a penny. It's...

how can I find out trace dependents on other pages
I want to find out trace dependents, how can I find out trace dependents on other pages? -- PETER After clicking Tools > Formula Auditing > Trace Precedents/Dependents, if you were to double-click on the dotted arrow that points to a mini sheet icon, that'll bring up a "Go To" dialog to navigate to either the precedent(s) / dependent(s) -- Max Singapore http://savefile.com/projects/236895 xdemechanik --- "Peter" <peter.oellinger@t-online.de> wrote in message news:7280B569-F4B6-4EB4-A79A-6852BAF7949E@microsoft.com... >I want to find out trace depen...

Can't get auto-update (update) to install
Version: 2008 Operating System: Mac OS X 10.4 (Tiger) Processor: Power PC I've been trying to manually check for updates to Word 2008, and I get a &quot;critical update&quot; notice, asking me to install auto-update. When I try to install it, I cannot. It just keeps repeating the attempt, in an &quot;endless loop.&quot; What to do? <br> Thank you. ...

Spreadsheet getting corrupted
Hello All: I have a relatively large spreadsheet. I am getting errors (see after my signature line). What could be causing these errors? Is it that the spreadsheet is too large? Thanks Deguza -------------------------------------------------------- Microsoft Office Excel File Repair Log Errors were detected in file 'C:\Documents and Settings\deguza\My Documents\sales\Sales_2006_2007.xls' The following is a list of repairs: Global PivotTable report information was repaired due to integrity problems. Global PivotTable report information was repaired due to integrity problems. Glo...

Change Excel Icon
Is there any way that the Excel Icon can be changed (without creating a shotcut) but still open as an excel application when clicked? Many Thanks. Kevin. Right click the icon, go to properties, select Change Icon. "kevin" <kevin@discussions.microsoft.com> wrote in message news:BD3D14AE-46DA-4D03-944F-B04BF1DA0D8C@microsoft.com... > Is there any way that the Excel Icon can be changed (without creating a > shotcut) but still open as an excel application when clicked? > > Many Thanks. > > Kevin. Kevin AFAIK you cannot change the icon for the Excel.exe...

Reg getting the next IV Document Number field !
Hi, I am creating a window in dexterity similar to the item transaction entry window (Transactions>Inventory> Transaction Entry). In the Item transaction Entry window, the Document number field defaults to the next document number when we move the focus to that field. I wanted to know if there is any function , or table that i can access to get the next document number in the new window that i am creating. Thanks, swetha -- swetha >In the Item transaction Entry window, the Document number field defaults to the next document number when we move the focus to that field.< T...

How do I get??
Sorry if this seems a fairly easy question to you guys. I have a spreadsheet and I need to get the current system time into a cell. The format of the time is hh:mm am/pm. Any assistance would be most helpful. Hi try =INT(NOW()) in this cell and format is to your needs -- Regards Frank Kabel Frankfurt, Germany PM wrote: > Sorry if this seems a fairly easy question to you guys. > > I have a spreadsheet and I need to get the current system time into a > cell. The format of the time is hh:mm am/pm. > > Any assistance would be most helpful. PM, in the cell you want pu...

Need to change data entered into cell. HELP ASAP!!
I have a list of over 7000 unique numbers (i.e. 123 or 77- 123). I need to add the letters "MH" in front of each number. Is there an easier way to do this than to click and edit each individual cell manually? Please help, anyone have any suggestions? Lots of thanks in advance. Hi one way (if you only have numbers): use acustom format : "MH"0 another way: in the adjacent column in row one (lets say in B1) enter the formula ="MH" & A1 copy this formula down After this select column B and copy the contents (CTRL+C). goto 'Edit - Paste Special' a...

Get notified when Out of Office is on
I am using Outlook 2007. With 2003, when returning from leave, I used to get a notification that the Outlook out of office was still on and asking me if I wanted to switch it off. This reminder no longer appears with 2007. How can I switch this setting on so that I get the notification? "Mary Ann" <MaryAnn@discussions.microsoft.com> wrote in message news:ED5533A7-D0EA-41B8-B1A0-A9D15FB6FD98@microsoft.com... >I am using Outlook 2007. With 2003, when returning from leave, I used to get > a notification that the Outlook out of office was still on and asking me ...

problems copying invoice form but then changing to a different font
I've downloaded an Invoice form (in .doc format) but the downloaded version has a font where all the letters appear unnaturally compressed. I've tried to change it to a more readable font (select all, then changed font to Arial, size to 10). Now the letters/font look good but the different lines and text entries are in the wrong positions. It looks like the size of the original page won't accomodate the new font and parts of the text have shifted to incorrect positions. If this is just a page size problem, how would I go about adjusting the new document before I change...

How to change asset class of mutual fund investment?
The dollar amount of the Other asset class in my current asset allocation shown on the "Compare current and target asset allocation" page is incorrect. Also, the percentage value of the Other asset class on the "Review your current asset allocation" page is incorrect. This occurred after I clicked a link to set the asset class of a mutual fund investment. The link appeared on the "Review your current asset allocation" page. Beforehand, the mutual fund was not assigned an asset class. How do I change the asset class? The link disappeared after setting t...

Error -2147024773 when changing passwords in OWA
Hi, Mac clients cant seem to change their Windows password using OWA. The error number -2147024773 appears during the password change process. Can anyone help? Other information: Exchange Server 2003/Windows Server 2003 in mixed mode: with SSL installed and the "Change Password Feature in Outlook Web Access" enabled (KB327134) Macs: OS 9 using IE4.5 and IE5. Windows PCs can change passwords without problem. Intermittently I can change the password on the IE4.5 Mac but most of the time I get the error above. Thanks, Martin Can user's who are using a PC change their domain...

over VPN, it gets stuck when sending outgoing email
When I use VPN to connect to work from home, the outlook can not finish sending outgoing emails. The progress bar moves to the end but then stops there forever. It can never finish. The receiving of new incoming emails work fine. All other network functionality works, e.g. internet browsing, telnet, ftp, etc, all work fine. My system is win2k. I use linksys wireless DSL router. I'd appreciate any hint! Are you using Exchange server? I'd set up your mail profile to prompt you to work offline or online - when using VPN, work offline with scheduled syncs. If not using exchange, pos...

How to change account used for replies from default
Hi I am using OL2007 on exchange 2007, have pretty minimal VBA skills (mainly in excel). I have several email addresses (a,b,c) which are all funnelled via my exchange account (d). The problem is that when i reply to an email sent to account a, OL automatically uses my exchange account (d). Is it possible to change this using vba so that outlook chooses the same account to send that the email was sent to? thanks David M If the message was retrieved (pulled) using an SMTP account, the replies will be sent using the right account - on the low level, the message gets ...

Getting Control ID in Active X control
GetWindowLong return 0. You need to call GetDlgCtrlID from outside the activex control as the function available within the control returns an arbitrary value of zero. Take a look at this article http://xendra.ens.uabc.mx/~sinfante/loo/libro/ch17_4.htm particularly the paragraph preceeding the title "MFC and Ambient Properties". This really begs the question why you want the ID in the first place as activex controls have to be fully self containing to operate - with a few exceptions where sibling controls need to be able to locate each other. - Tim "ytv" <...

Block Users from changing permissions
How can i stop users from changing permissions on their mailboxes. For example, we have 20 CSR's that I what to block from being able to change how their calender and contacts are shared. Only managers should be able to access their calenders, but they like to grant each other the permissions to do so. Also, is there a way to do this by group or mailbox store? I have tried playing with the permissions on the Exchange Advanced tab in AD users and computers to no avail, i have checked the deny on change permissions on Self, but it doesnt seem to have any affect. Thanks PS. Exchange 2003 S...

Changing the X/Z/ZZ Reports
Are there customized X/Z/ZZ Reports out there? For starters, I'd like to be able to do a break down of the "Discounts" instead of one total. I use several different "REASON Codes" for the discounts. Is it possible modify these reports to show each Discount Reason Code and its corresponding amount that day? Please help my bookkeeper is killing me! :-D David There is no way of doing what you ask with the X/Z or even the ZZ reports, it is a limitation of the receipts. You could instead run a report to show this information. The Detailed Sales Report has the D...