473,503 Members | 13,028 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Capturing Mysterious Truncation/deletion of a table

I have a dts which creates a table which is utilized on my local
intranet. The DTS runs without error and the table is
created/populated/transfered to the appropriate db. Then it appears
that there is an action on this table which truncates it. I have been
unable to determine the culprit. Can I create a trigger that will
capture truncation? I have tried to create a trigger to capture this
information but none that I attempt seem to work on capturing a
truncation or a drop table and re-create.

Any help would be greatly appreciated.

MT.

Feb 14 '06 #1
2 1860
On 14 Feb 2006 11:22:25 -0800, co******@hotmail.com wrote:
I have a dts which creates a table which is utilized on my local
intranet. The DTS runs without error and the table is
created/populated/transfered to the appropriate db. Then it appears
that there is an action on this table which truncates it. I have been
unable to determine the culprit. Can I create a trigger that will
capture truncation? I have tried to create a trigger to capture this
information but none that I attempt seem to work on capturing a
truncation or a drop table and re-create.

Any help would be greatly appreciated.

MT.


Hi MT,

In SQL Server 2000, there is no way to monitor either truncation or
dropping of a table using triggers. You'll have to use Profiler to find
out who/what is destorying your data.

--
Hugo Kornelis, SQL Server MVP
Feb 14 '06 #2
(co******@hotmail.com) writes:
I have a dts which creates a table which is utilized on my local
intranet. The DTS runs without error and the table is
created/populated/transfered to the appropriate db. Then it appears
that there is an action on this table which truncates it. I have been
unable to determine the culprit. Can I create a trigger that will
capture truncation? I have tried to create a trigger to capture this
information but none that I attempt seem to work on capturing a
truncation or a drop table and re-create.


You can add a trigger FOR DELETE on the table, that will capture the
the truncation happens through DELETE.

However, the trigger will not catch if the table is emptied by
TRUNCATE TABLE or DROP TABLE + ALTER TABLE. One way you can handle
this is to add a table that has a foreign key referencing this table.
This will cause TRUNCATE TABLE and DROP TABLE to fail.

Have you examined the possibility that the reason the data disappears
is because there is a transaction that is not committed, so the
population of the table is simply rolled back?

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Feb 14 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
6563
by: Tuhin Kumar | last post by:
Hi, I have a requirement on improving the deletion rate on on records of a table. The table contains 5 million records, but since deleting everything matching the condition at one go was giving...
0
1751
by: Vic | last post by:
Hi all, When I test the Delete multi table function in MySQL, DELETE table_name ...] FROM table-references I accidentally delete all data in one table. All data in that table are gone...
1
4436
by: hharry | last post by:
Hello All, I am attempting a bulk load of fixed position flat file data via bcp and I have noticed that I get a Right Truncation error when trying to load a row where the last column value is...
2
1763
by: M Wells | last post by:
Hi All, I'm trying to track down a mysterious problem we're experiencing in which updates and inserts to tables in our mssql2k server appear to be 'disappearing.' To explain our situation: ...
2
1713
by: Rune Froysa | last post by:
I have one table with columns that are used as foreign-keys from several other tables. Sometimes deletion from this table takes +5 seconds for a single row. Are there any utilities that can be...
2
6815
by: mudassir.latif | last post by:
Hi, I'm trying to upload a large number of log entries currently stored as text files into a database table using bcp. For a few rows I get a "right truncation" error and the offending rows are...
4
6974
by: Neil | last post by:
Using SQL 7 with an Access 2000 MDB front end with ODBC linked tables. Have a DateModified field which previously was smalldatetime. Changed over the weekend to datetime. Field is updated with a...
1
1845
by: Serman D. | last post by:
Background: The Payment Card Industry (PCI) Data Security Standard (PCI DSS) is a standard for financial institutions. It requires sensitive information, such as credit card numbers, to be...
3
3655
by: AdrianHC | last post by:
I have an access database, 2000, linked to SQL tables. The primary SQL table includes some memo fields. When I open the table in access, the memo fields are shown in full but when I include...
0
7098
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7296
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7364
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7470
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5604
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4696
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3174
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1524
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
751
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.