Khắc phục lỗi no row was updated trong sql năm 2024

Khi đã thử các cách kill deadlock process hoặc là restart sqlserver service nhưng vẫn bị không thể insert/update record vào table nhưng vẫn query bình thường. Application kết nối vào query ra dữ liệu nhưng write vào là bị timeout. DBCC chạy rồi cũng cứng đơ.

Có thể khi chạy script sql sẽ nhận được kết quả từ sql management studio như thế này: “A severe error occurred on the current command. The results, if any, should be discarded.”.

Lỗi này có nhiều nguyên nhân. 1 trong những nguyên nhân phổ biến là do index table nào đó bị corrupted. Do đó cách đáng để thử khi quá bí là rebuild lại index của table mình nghi là bị corrupted. Để biết table corrupted thì sẽ lần theo blocked by process/query.

I am trying to manually edit a database in Visual Studios 2010! However, when I try to insert data into the table I receive the following error:

No row was updated. The data in row 1 was not committed. Error Source: .Net SqlClient Data Provider. Error Message: String or Binary data would be truncated. The statement has been terminated.

I have encountered this error a while ago but I have forgotten how I solved it.

Thanks,

Nightwalker

when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button. If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu. //get.cryptobrowser.site/30/4111672
  • Dec 20th, 2012, 07:24 AM

    Re: No row was updated. The data in row 1 was not committed.
    String or Binary data would be truncated.

    That typically means you're trying to enter more data into a field that it can accept, e.g. 51 characters in to a varchar(50) field. The best argument against democracy is a five minute conversation with the average voter - Winston Churchill

Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd

-
  • Dec 20th, 2012, 07:09 PM

    Re: No row was updated. The data in row 1 was not committed.

    Ah ok! Looking at a project that is alost identical but works the definition for the particular field which is causing problem is "nvarchar(1024)" however, in this table that particular field is set to "nvarchar(10)" definitely not big enough. However, if I try to make the change I receive the following error:

You cannot save changes that would result in one or more tables being re-created. You can override this behavior by changing your configuration options. Open the Tools menu, click Options. In the Options dialog box, expand the Database Tools node and click Table and Database Designers. You can clear the "Prevent saving changes that require table re-creation" then retry the save operation. The save might take a long time because the data in the tables must be copied to temporary tables.

Will try this and report back.

Edit:

Damn, there are only four node under Options, Environment, Projects and Solutions, Text Editor and Windows Forms Designer. Last edited by Nightwalker83; Dec 20th, 2012 at 07:14 PM.Reason: Adding more! when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button. If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu. //get.cryptobrowser.site/30/4111672

- Dec 21st, 2012, 05:00 AM

Re: No row was updated. The data in row 1 was not committed.

Are you looking in Management Studio? My Options dialog has a Designers node and I found the flag quite easily under there. If you can't find the option you can always carry out the steps yourself manually. Copy all the data sideways into a new table, drop the existing table and recreate it exactly as it was before but with the one column redefined. Don't forget that the table is more than just the data it contains, you want to make sure you recreate all the same indexes, triggers, constraints etc so make absolutely sure you know exactly what's there before you do anything. Scripting the various elements for create will do alot of the work for you.

Be cautioned, though, that this isn't something you should be doing lightly. What that message is telling you is that, in order to make that change, the DBMS (or you) is going to have to completely delete and recreate that table. If you get some catastrophic problem half way through that process you could get left in a right mess. So before you do anything TAKE A FULL BACKUP. The best argument against democracy is a five minute conversation with the average voter - Winston Churchill

Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd

Dec 21st, 2012, 06:48 AM

Re: No row was updated. The data in row 1 was not committed.

Management Studio? I am referring to the Tools, Options menu in Visual Studios.

Edit:

Forgot to uncheck the "Show all settings" check box! After that I was able to located the setting I was looking for under the "Table and Database Designers" node and "Table and Diagram Option". Unchecking the "Prevent saving changes that require table re-creation" check box and clicking "OK" solved the problem. Last edited by Nightwalker83; Dec 21st, 2012 at 07:13 AM.Reason: Fixed spelling! when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button. If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu. //get.cryptobrowser.site/30/4111672

-
  • Nov 12th, 2013, 02:14 AM

    Frenzied Member

    -

    Re: [RESOLVED] No row was updated. The data in row 1 was not committed.

    I'm getting this SQL Server error when I go to update a "text" field which only has a couple of hundred characters in it. How can this be? Can I safely just update the field type to "varchar(max)" without losing any data from that field?

Chủ đề