473,378 Members | 1,344 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,378 software developers and data experts.

WARNING. A simple cut and paste of 8 records can distroy a SQL Server table

Today I need to copy 8 records in a table. I have to use Access 200 because
of the limitation of Enterprise Manager's inability to cope with field with
more than 900 characters. Selected records, cut, paste. I got an erroor
message about not being able to have a null Key_ID (I copied the reords and
tried to paste the Key_ID as part of the records - normally I hide the
Key_ID).
Now I can't access either the new records or the originals that I was trying
to copy (because, it would seem, they have identical primary keys). I also
cannot export the table via DTS 'unspecified error' and 'integrity
violation'.
Or delete the offending records with a Query Anaylyser delete query.
Basically the entire SQL Server database has been destroyed with a couple of
keystrokes.
Now, I've being developing database applications for over 20years and the
one thing, maybe the only thing I expect from a database server is to
protect the integrity of my data. SQL Server does not, it would seem. These
records aren't just any random unimportant records either. They contain the
'create views' that my entire application require to function and each one
approaches the 8000 record limit and have take years to perfect and just
checking that the table is valid could take me days.
Jul 20 '05 #1
5 1802
SWu
sorry if this sounds like a couple of dumb, obvious questions:
- do you have backups of this important code?
- are you able to drop the constraints on the table, remove the offending
records and reapply the constraints?

regards,
stephen
"pete" <pe**@madpete.freeserve.co.uk> wrote in message
news:40**********************@news.zen.co.uk...
Today I need to copy 8 records in a table. I have to use Access 200 because of the limitation of Enterprise Manager's inability to cope with field with more than 900 characters. Selected records, cut, paste. I got an erroor
message about not being able to have a null Key_ID (I copied the reords and tried to paste the Key_ID as part of the records - normally I hide the
Key_ID).
Now I can't access either the new records or the originals that I was trying to copy (because, it would seem, they have identical primary keys). I also
cannot export the table via DTS 'unspecified error' and 'integrity
violation'.
Or delete the offending records with a Query Anaylyser delete query.
Basically the entire SQL Server database has been destroyed with a couple of keystrokes.
Now, I've being developing database applications for over 20years and the
one thing, maybe the only thing I expect from a database server is to
protect the integrity of my data. SQL Server does not, it would seem. These records aren't just any random unimportant records either. They contain the 'create views' that my entire application require to function and each one
approaches the 8000 record limit and have take years to perfect and just
checking that the table is valid could take me days.

Jul 20 '05 #2
Yes I have a backup from yesterday, but it was a 14hour day and I don't ever
want to reapeat it.. But your sugguestion about removing the constraint
helped, I could delete them. Thanks.

"SWu" <sw@rgrzz.com.au> wrote in message
news:uu**************@TK2MSFTNGP11.phx.gbl...
sorry if this sounds like a couple of dumb, obvious questions:
- do you have backups of this important code?
- are you able to drop the constraints on the table, remove the offending
records and reapply the constraints?

regards,
stephen
"pete" <pe**@madpete.freeserve.co.uk> wrote in message
news:40**********************@news.zen.co.uk...
Today I need to copy 8 records in a table. I have to use Access 200 because
of the limitation of Enterprise Manager's inability to cope with field

with
more than 900 characters. Selected records, cut, paste. I got an erroor
message about not being able to have a null Key_ID (I copied the reords

and
tried to paste the Key_ID as part of the records - normally I hide the
Key_ID).
Now I can't access either the new records or the originals that I was

trying
to copy (because, it would seem, they have identical primary keys). I also cannot export the table via DTS 'unspecified error' and 'integrity
violation'.
Or delete the offending records with a Query Anaylyser delete query.
Basically the entire SQL Server database has been destroyed with a couple of
keystrokes.
Now, I've being developing database applications for over 20years and

the one thing, maybe the only thing I expect from a database server is to
protect the integrity of my data. SQL Server does not, it would seem.

These
records aren't just any random unimportant records either. They contain

the
'create views' that my entire application require to function and each one approaches the 8000 record limit and have take years to perfect and just
checking that the table is valid could take me days.


Jul 20 '05 #3
pete (pe**@madpete.freeserve.co.uk) writes:
Today I need to copy 8 records in a table. I have to use Access 200
because of the limitation of Enterprise Manager's inability to cope with
field with more than 900 characters. Selected records, cut, paste. I
got an erroor message about not being able to have a null Key_ID (I
copied the reords and tried to paste the Key_ID as part of the records -
normally I hide the Key_ID).

Now I can't access either the new records or the originals that I was
trying to copy (because, it would seem, they have identical primary
keys). I also cannot export the table via DTS 'unspecified error' and
'integrity violation'.
Or delete the offending records with a Query Anaylyser delete query.
Basically the entire SQL Server database has been destroyed with a
couple of keystrokes.
Now, I've being developing database applications for over 20years and the
one thing, maybe the only thing I expect from a database server is to
protect the integrity of my data. SQL Server does not, it would seem.
SQL Server protects the integrity of your data, as far as you tell it
what to protect. It cannot make random guesses.

In any case, it is impossible to tell what happened, since you also
involved Access. "Cut and paste" is not a concept that exists in
SQL Server proper. If Access implemented the cut-and-paste with a
DELETE and INSERT, and the INSERT failed, and did not use a transaction,
then SQL Server have to plead innocent.
These records aren't just any random unimportant records either. They
contain the 'create views' that my entire application require to
function and each one approaches the 8000 record limit and have take
years to perfect and just checking that the table is valid could take me
days.


It seems a little funny to me that you store source code in a database
table. I would use a version-control system.

But assuming that you had created the views, you can use sp_helptext
to get SQL Server's version of the views. There are also scripting
facilities in Enterprise Manager.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #4
If you have a field name of more than 900 characters, then its your own
silly fault.
On the other hand it could be that you had a unique index on that was
created with(nocheck), which would explain why you could delete records, but
couldn't put them back in again.

"pete" <pe**@madpete.freeserve.co.uk> wrote in message
news:40**********************@news.zen.co.uk...
Today I need to copy 8 records in a table. I have to use Access 200 because of the limitation of Enterprise Manager's inability to cope with field with more than 900 characters. Selected records, cut, paste. I got an erroor
message about not being able to have a null Key_ID (I copied the reords and tried to paste the Key_ID as part of the records - normally I hide the
Key_ID).
Now I can't access either the new records or the originals that I was trying to copy (because, it would seem, they have identical primary keys). I also
cannot export the table via DTS 'unspecified error' and 'integrity
violation'.
Or delete the offending records with a Query Anaylyser delete query.
Basically the entire SQL Server database has been destroyed with a couple of keystrokes.
Now, I've being developing database applications for over 20years and the
one thing, maybe the only thing I expect from a database server is to
protect the integrity of my data. SQL Server does not, it would seem. These records aren't just any random unimportant records either. They contain the 'create views' that my entire application require to function and each one
approaches the 8000 record limit and have take years to perfect and just
checking that the table is valid could take me days.

Jul 20 '05 #5
Beeeeeves (beeeeeeeeev@ves) writes:
On the other hand it could be that you had a unique index on that was
created with(nocheck), which would explain why you could delete records,
but couldn't put them back in again.


There is NOCHECK for indexes. You can say NOCHECK with UNIQUE and PRIMARY
KEY constraints, but it does not have any effect. NOCHECK only applies
to CHECK and FOREIGN KEY constraints.

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

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #6

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

Similar topics

109
by: Andrew Thompson | last post by:
It seems most people get there JS off web sites, which is entirely logical. But it is also a great pity since most of that code is of such poor quality. I was looking through the JS FAQ for any...
1
by: andree | last post by:
Hello, I have a form where a user may paste multiple records. The form has an AfterInsert procedure. The procedure copies the newly inserted record into a different table for audit purposes. ...
9
by: Pete | last post by:
Does anyone have a simple html vbscript or other type of snippet they can share that appends a record to a access database via ADO or DAO? I would like to allow users that don't have Microsoft...
1
by: PalJoey | last post by:
I am having a problem copying and pasting records into the same table. When I copy a record that has a zero length string for a field Access seems to convert it to NULL when pasted. One of the...
2
by: Fendi Baba | last post by:
I created a person table with various fields such as Suffix, Salutation, etc, Some of these fields may not be mandatory for example suffix. In the actual table itself, I only have a field for...
6
by: dimitris.papastamos | last post by:
Hello everyone, I've been working on a simple editor myself and I seem to be having some problems with ncurses or so. I have been debugging this program quite a lot trying to detect where the bug...
7
kcdoell
by: kcdoell | last post by:
Good morning everyone: I created a form and set the default view as a continuous form. Basically the form is displaying records in which the user can add or edit new ones. The record source for...
5
by: phill86 | last post by:
Hi I have a main form that holds records for scheduled meetings, date time location etc... in that form i have a sub form that has a list of equipment resources that you can assign to the meeting in...
6
by: Phil Stanton | last post by:
My Ak2 databas has been running successfully for many years althogh it gets upgraded regularly. I now find on this, and other dbs, when I delete a record I no longer get the message "You are...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.