Results 1 to 5 of 5

Thread: corrupted table

  1. #1
    Join Date
    Oct 2006
    Posts
    2

    Exclamation corrupted table

    I have this application which some how inserted the incorrect data into the wrong column. The comumn in question is int and the data is text well needless to say things are getting strange with the table. I tried unsuccessfully to restore from backup I am probably doind something wrong or missing something. I have tried unsuccessfully to find the row in question and delelte it or at least change the data. I would appreciate and suggestions.

    Thanks in advance
    Edit/Delete Message

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    It's impossible to insert text into int column in sql server. By the way, how did you restore db?

  3. #3
    Join Date
    Sep 2005
    Posts
    168
    if text could be converted into a number, it is possible to be inserted into a numeric field.

    DECLARE @test TABLE (number smallint)

    INSERT INTO @test values (CAST('1' AS VARCHAR))
    INSERT INTO @test VALUES ('2')
    SELECT * FROM @test

    --In order to find the row in question use the ISNUMERIC function

    --HTH--

  4. #4
    Join Date
    Sep 2002
    Posts
    5,938
    It's number in text data type, but I don't think that's the case in original post.

  5. #5
    Join Date
    Oct 2006
    Posts
    2
    mikr0s

    Thanks for the reply. I found the error using the ISNUMERIC function. How the data became lodged into the wrong column I am not sure but getting that needle in a hay stack out of there work like a charm. All is well in the land of DB. Thanks to every one else who replied. Regards

    rmiao I tried the back up restore by highlighting the db then rt click the go to ttasks/restore/database/ go to file select back up file then try and finish
    Last edited by sqlWhat; 10-15-2006 at 11:48 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •