473,396 Members | 1,754 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 1343
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*******@comcast.net> wrote in message
news:a8*************************@posting.google.co m...
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*******@comcast.net> wrote in message
news:a8*************************@posting.google.co m...
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
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...
5
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='...
1
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,...
7
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...
0
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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
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
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...

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.