Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
Thread: MSSQL 2K Overwriting data
06-15-2007, 07:36 PM #1
- Join Date
- Dec 2002
- Arlington, Texas USA
- Thanked 11 Times in 11 Posts
MSSQL 2K Overwriting data
We have recently had an issue where some fields are being overwritten in the SQL Server 2000. The data is in the form of a string and depending on which field is being overwritten they are between 18 and 76 characters in length. Each field is a string of the same length. The SPROC's used to update the data are passed 2 parameters. 1 of them is an identifier (the UserID) which consists of 2 alpha characters followed by between 4 and 7 numeric characters. The data type is set to char(9) for this field. This field is set to be a foreign key to another table (there is no primary key set in this table.) Then there is the string that is passed which is just a string consiting of 0,1,2 or 3 and in one case 0-5 and would look something like this 11231313132213311213... again these are set dependant on the individual field that we are updating and are set as char and set to the length of the string. It has recently become a problem where 1 of the databases has had the fields that hold the strings overwritten.
In our older DB's the identifier that was passed was a number that was from an identifier field, and the datatype of the columns that hold the strings in these older DB's was set to varchar(100).
Could this possibly be because of the new ID system that was implemented that is causing this on occasion to overwrite records? The ID's are not similar and the only way we know it is happening is that there are records where all 5 of the fields are the same. and the odds of that happeneing are phenomenal. 76 to the 3rd for one column 40 to the 4th for another, 18 to the 6th for another, etc...
So does anyone have any ideas what could cause this to overwrite? Here is one of the SPROCs that is used to add the data
@UserID char(9), @A1 char(40) AS BEGIN UPDATE eDataTable SET A1 = @A1, Completed = '2' WHERE UserID = @UserID END GO