473,569 Members | 2,772 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help with delete

I am having an issue with the way SQL server deletes data. I am
trying to delete data from the DB and have it completetly gone.

Here is what I did

1. added a table with a row of image data
2. inserted a text file into the row with a string i could search
for.
3. opened the mdf file up in a hex editor and found the data
4. deleted the row in sql server
5. reopened the file in the hex editor and the data was still there

no matter what i do i cant get rid of the data from the file. i have
tried shrinkdatabase, update and updatetext to overwrite the data and
nothing works.

anyone know how to REALLY delete things from an SQL DB?

Thanks
Jul 20 '05 #1
2 1349
Ton
Andy,

You're delete is still in the transaction log and the lazy writer didn't
write to the datafiles.

The lazy writer writes to the datafiles, when the interval has exceeded or
when the buffer is full. So when you delete something it isn't directly
written to the datafiles. Also be carefull opening datafiles in a hexeditor,
because you will destroy everthing !!

To understand this you have to learn something about the architecture of
sqlserver.

Gr Ton
"andy" <aj*******@comc ast.net> wrote in message
news:a8******** *************** **@posting.goog le.com...
I am having an issue with the way SQL server deletes data. I am
trying to delete data from the DB and have it completetly gone.

Here is what I did

1. added a table with a row of image data
2. inserted a text file into the row with a string i could search
for.
3. opened the mdf file up in a hex editor and found the data
4. deleted the row in sql server
5. reopened the file in the hex editor and the data was still there

no matter what i do i cant get rid of the data from the file. i have
tried shrinkdatabase, update and updatetext to overwrite the data and
nothing works.

anyone know how to REALLY delete things from an SQL DB?

Thanks

Jul 20 '05 #2
Is there any way to bypass this functionality or force SQL server to
write the data? The only proven method I have is to export the entire
database and import it back into a new DB and that is extremely time
consuming.

How about setting the allow bulk insert flag on the DB or something?

"Ton" <t.****@wanadoo .nl> wrote in message news:<41******* *************** *@news.wanadoo. nl>...
Andy,

You're delete is still in the transaction log and the lazy writer didn't
write to the datafiles.

The lazy writer writes to the datafiles, when the interval has exceeded or
when the buffer is full. So when you delete something it isn't directly
written to the datafiles. Also be carefull opening datafiles in a hexeditor,
because you will destroy everthing !!

To understand this you have to learn something about the architecture of
sqlserver.

Gr Ton
"andy" <aj*******@comc ast.net> wrote in message
news:a8******** *************** **@posting.goog le.com...
I am having an issue with the way SQL server deletes data. I am
trying to delete data from the DB and have it completetly gone.

Here is what I did

1. added a table with a row of image data
2. inserted a text file into the row with a string i could search
for.
3. opened the mdf file up in a hex editor and found the data
4. deleted the row in sql server
5. reopened the file in the hex editor and the data was still there

no matter what i do i cant get rid of the data from the file. i have
tried shrinkdatabase, update and updatetext to overwrite the data and
nothing works.

anyone know how to REALLY delete things from an SQL DB?

Thanks

Jul 20 '05 #3

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

Similar topics

2
3911
by: matt | last post by:
I have compiled some code, some written by me, some compiled from various sources online, and basically i've got a very simple flat file photo gallery. An upload form, to upload the photos and give them a caption, storing the caption and filename in a text file. It's a bit buggy when removing the photos and captions from the file, and also in...
5
2129
by: xuatla | last post by:
Hi, I encountered the following compile error of c++ and hope to get your help. test2.cpp: In member function `CTest CTest::operator+=(CTest&)': test2.cpp:79: error: no match for 'operator=' in '*this = CTest::operator+(CTest&)((+t2))' test2.cpp:49: error: candidates are: CTest CTest::operator=(CTest&) make: *** Error 1
1
2415
by: MultiTaskinG | last post by:
I want to retrieve all comment stored from my web users ordered BY THREAD and BY TIMESTAMP (INT 11) with a single query (if is possible) now I launch this query: SELECT thread, timestamp, level FROM comments WHERE articleid=16 ORDER BY thread, timestamp,level
7
2479
by: Dynamo | last post by:
I am using values stored an $_POST array to display records from a table before asking the user if he is sure he wants to delete them. If the user confirms then the records are deleted. Without boring you with all of the code here is the rough idea. <?php $delete = '( id = ' . implode(' OR id = ', $_POST ) . ' ) '; if (!isset($_POST)) {...
0
4105
by: hagar | last post by:
Hi all, I have a problem which I can not understand why this is happening! Debugging this I actually see that it grabs first record then when stepping through code to the line rsImportTo.AddNew it drops first record and grabs second record and continues on no problems (but no 1st record in data set) I am reading a text file record 1 is a top...
0
7694
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7921
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8118
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7666
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6278
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5217
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2107
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 we have to send another system
0
936
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.