Msg 547, Level 16, State 0, Line 1
The INSERT statement conflicted with the FOREIGN KEY constraint «FK_Sup_Item_Sup_Item_Cat». The conflict occurred in database «dev_bo», table «dbo.Sup_Item_Cat». The statement has been terminated.
insert into sup_item (supplier_id, sup_item_id, name, sup_item_cat_id,
status_code, last_modified_user_id, last_modified_timestamp, client_id)
values (10162425, 10, 'jaiso', '123123',
'a', '12', '2010-12-12', '1062425')
The last column client_id
is causing the error. I tried to put the value which already exists in the dbo.Sup_Item_Cat
into the column, corresponding to the sup_item.
philipxy
14.8k6 gold badges39 silver badges82 bronze badges
asked Jun 3, 2010 at 12:24
SmartestVEGASmartestVEGA
8,37526 gold badges84 silver badges137 bronze badges
1
Your table dbo.Sup_Item_Cat
has a foreign key reference to another table. The way a FK works is it cannot have a value in that column that is not also in the primary key column of the referenced table.
If you have SQL Server Management Studio, open it up and sp_help
‘dbo.Sup_Item_Cat
‘. See which column that FK is on, and which column of which table it references. You’re inserting some bad data.
philipxy
14.8k6 gold badges39 silver badges82 bronze badges
answered Jun 3, 2010 at 12:29
2
The answer on this page by Mike M. is correct:
The way a FK works is it cannot have a value in that column that is not also in the primary key column of the referenced table.
What is missing from that answer is: You must build the table containing the primary key first.
You must insert data into the parent table, containing the primary key, before attempting to insert data into the foreign key.
After adding the primary key data, your foreign key data in the child table must conform to the primary key field in the parent table.
philipxy
14.8k6 gold badges39 silver badges82 bronze badges
answered Jan 17, 2014 at 20:50
plasmasnakeneoplasmasnakeneo
2,2211 gold badge13 silver badges16 bronze badges
1
You are trying to insert a record with a value in the foreign key column that doesn’t exist in the foreign table.
For example: If you have Books and Authors tables where Books has a foreign key constraint on the Authors table and you try to insert a book record for which there is no author record.
Katianie
5851 gold badge9 silver badges37 bronze badges
answered Jun 3, 2010 at 12:31
Matthew SmithMatthew Smith
1,2771 gold badge9 silver badges19 bronze badges
0
That error means that the table you are inserting data into has a foreign key relationship with another table. Before data can be inserted, the value in the foreign key field must exist in the other table first.
philipxy
14.8k6 gold badges39 silver badges82 bronze badges
answered Jun 3, 2010 at 12:27
Justin NiessnerJustin Niessner
242k40 gold badges408 silver badges536 bronze badges
The problem is not with client_id from what I can see. It looks more like the problem is with the 4th column, sup_item_cat_id
I would run
sp_helpconstraint sup_item
and pay attention to the constraint_keys column returned for the foreign key FK_Sup_Item_Sup_Item_Cat to confirm which column is the actual problem, but I am pretty sure it is not the one you are trying to fix. Besides ‘123123’ looks suspect as well.
answered Jun 3, 2010 at 12:44
CobusveCobusve
1,56210 silver badges23 bronze badges
All the fields have to match EXACTLY.
For example, sending ‘cat dog’ is not the same as sending ‘catdog’.
To troubleshoot this: Script out the FK code from the table you ae inserting data into, take note of the «Foreign Key» that has the constraints and make sure those fields’ values match EXACTLY as they were in the table throwing the FK Constraint error.
Fix the fields.
philipxy
14.8k6 gold badges39 silver badges82 bronze badges
answered May 30, 2014 at 21:06
John WaclawskiJohn Waclawski
9361 gold badge11 silver badges20 bronze badges
0
My insert value fields contained tabs and spaces that were not obvious to the naked eye. I had created my value list in Excel, copied, and pasted it to SQL, and run queries to find non-matches on my FK fields.
The match queries did not detect there were tabs and spaces in my FK field, but the INSERT did recognize them and it continued to generate the error.
I tested again by copying the content of the FK field in one record and pasting it into the insert query. When that record also failed, I looked closer at the data and finally detected the tabs/spaces.
Once I cleaned removed tabs/spaces, my issue was resolved.
philipxy
14.8k6 gold badges39 silver badges82 bronze badges
answered Oct 23, 2015 at 13:40
Double check the fields in the relationship the foreign key is defined for. SQL Server Management Studio may not have had the fields you wanted selected when you defined the relationship. This has burned me in the past.
answered Jan 6, 2014 at 19:27
- run sp_helpconstraint
- pay attention to the constraint_keys column returned for the foreign key
philipxy
14.8k6 gold badges39 silver badges82 bronze badges
answered Apr 12, 2014 at 16:20
In my case, I was inserting the values into the child table in the wrong order:
For the table with 2 columns: column1
and column2
, I got this error when I mistakenly entered:
INSERT INTO Table VALUES('column2_value', 'column1_value');
The error was resolved when I used the below format:-
INSERT INTO Table (column2, column1) VALUES('column2_value', 'column1_value');
answered Sep 12, 2020 at 6:45
The problem was reproducible and intermittent for me using mybatis.
I had correct DB configuration (PK, FK, auto increment etc)
I had correct order of insertions (parent records first); in debug I could see the parent record inserted with respective PK and just after that next statement failed with inserting the child record with the correct FK inside.
The problem was fixed by reseeding identity with
DBCC CHECKIDENT ('schema.customer', RESEED, 0);
DBCC CHECKIDENT ('schema.account', RESEED, 0);
The code that failed before started to work.
philipxy
14.8k6 gold badges39 silver badges82 bronze badges
answered Apr 28, 2021 at 22:12
MikeMike
19.8k25 gold badges97 silver badges138 bronze badges
I used code-first migrations to build my database for an MVC 5 application. The seed method in my configuration.cs file was causing the issue, creating a table entry for the table containing the foreign key before creating the entry with the matching primary key.
philipxy
14.8k6 gold badges39 silver badges82 bronze badges
answered May 14, 2014 at 19:12
Paulie22Paulie22
1111 gold badge1 silver badge9 bronze badges
The error you’re encountering is due to a violation of the FOREIGN KEY constraint FK_Sup_Item_Sup_Item_Cat
when attempting to insert a value into the client_id column of the sup_item table. The error message indicates that the value you’re trying to insert does not exist in the referenced table Sup_Item_Cat in the dev_bo database.
To resolve this issue, you should ensure that the value you’re inserting into the client_id column matches an existing value in the referenced table Sup_Item_Cat. You can verify the available values in the Sup_Item_Cat
table and make sure you’re providing a valid client_id.
Here’s an example query to retrieve the existing client_id values from the Sup_Item_Cat table:
SELECT client_id
FROM dbo.Sup_Item_Cat;
Review the output of this query and confirm that the value you’re trying to insert into the client_id column exists in the Sup_Item_Cat
table.
To identify which other tables and columns a particular table depends on, you can use the information from the Keys folder and Depends on dbForge Studio for SQL Server.
answered Jun 22 at 15:18
1
I experienced same issue while running the query:
INSERT INTO [dbo].[work_flow_actions] ([work_flow_id] ,[actions_id]) VALUES (70004, 150044)
Meanwhile, I confirmed that the values 70004 and 150044 exist in the corresponding tables.
I fixed this by including the database name as follows:
INSERT INTO [TIS].[dbo].[work_flow_actions] ([work_flow_id] ,[actions_id]) VALUES (70004, 150044)
answered Jun 28 at 1:11
Msg 547, Level 16, State 0, Line 1
The INSERT statement conflicted with the FOREIGN KEY constraint «FK_Sup_Item_Sup_Item_Cat». The conflict occurred in database «dev_bo», table «dbo.Sup_Item_Cat». The statement has been terminated.
insert into sup_item (supplier_id, sup_item_id, name, sup_item_cat_id,
status_code, last_modified_user_id, last_modified_timestamp, client_id)
values (10162425, 10, 'jaiso', '123123',
'a', '12', '2010-12-12', '1062425')
The last column client_id
is causing the error. I tried to put the value which already exists in the dbo.Sup_Item_Cat
into the column, corresponding to the sup_item.
philipxy
14.8k6 gold badges39 silver badges82 bronze badges
asked Jun 3, 2010 at 12:24
SmartestVEGASmartestVEGA
8,37526 gold badges84 silver badges137 bronze badges
1
Your table dbo.Sup_Item_Cat
has a foreign key reference to another table. The way a FK works is it cannot have a value in that column that is not also in the primary key column of the referenced table.
If you have SQL Server Management Studio, open it up and sp_help
‘dbo.Sup_Item_Cat
‘. See which column that FK is on, and which column of which table it references. You’re inserting some bad data.
philipxy
14.8k6 gold badges39 silver badges82 bronze badges
answered Jun 3, 2010 at 12:29
2
The answer on this page by Mike M. is correct:
The way a FK works is it cannot have a value in that column that is not also in the primary key column of the referenced table.
What is missing from that answer is: You must build the table containing the primary key first.
You must insert data into the parent table, containing the primary key, before attempting to insert data into the foreign key.
After adding the primary key data, your foreign key data in the child table must conform to the primary key field in the parent table.
philipxy
14.8k6 gold badges39 silver badges82 bronze badges
answered Jan 17, 2014 at 20:50
plasmasnakeneoplasmasnakeneo
2,2211 gold badge13 silver badges16 bronze badges
1
You are trying to insert a record with a value in the foreign key column that doesn’t exist in the foreign table.
For example: If you have Books and Authors tables where Books has a foreign key constraint on the Authors table and you try to insert a book record for which there is no author record.
Katianie
5851 gold badge9 silver badges37 bronze badges
answered Jun 3, 2010 at 12:31
Matthew SmithMatthew Smith
1,2771 gold badge9 silver badges19 bronze badges
0
That error means that the table you are inserting data into has a foreign key relationship with another table. Before data can be inserted, the value in the foreign key field must exist in the other table first.
philipxy
14.8k6 gold badges39 silver badges82 bronze badges
answered Jun 3, 2010 at 12:27
Justin NiessnerJustin Niessner
242k40 gold badges408 silver badges536 bronze badges
The problem is not with client_id from what I can see. It looks more like the problem is with the 4th column, sup_item_cat_id
I would run
sp_helpconstraint sup_item
and pay attention to the constraint_keys column returned for the foreign key FK_Sup_Item_Sup_Item_Cat to confirm which column is the actual problem, but I am pretty sure it is not the one you are trying to fix. Besides ‘123123’ looks suspect as well.
answered Jun 3, 2010 at 12:44
CobusveCobusve
1,56210 silver badges23 bronze badges
All the fields have to match EXACTLY.
For example, sending ‘cat dog’ is not the same as sending ‘catdog’.
To troubleshoot this: Script out the FK code from the table you ae inserting data into, take note of the «Foreign Key» that has the constraints and make sure those fields’ values match EXACTLY as they were in the table throwing the FK Constraint error.
Fix the fields.
philipxy
14.8k6 gold badges39 silver badges82 bronze badges
answered May 30, 2014 at 21:06
John WaclawskiJohn Waclawski
9361 gold badge11 silver badges20 bronze badges
0
My insert value fields contained tabs and spaces that were not obvious to the naked eye. I had created my value list in Excel, copied, and pasted it to SQL, and run queries to find non-matches on my FK fields.
The match queries did not detect there were tabs and spaces in my FK field, but the INSERT did recognize them and it continued to generate the error.
I tested again by copying the content of the FK field in one record and pasting it into the insert query. When that record also failed, I looked closer at the data and finally detected the tabs/spaces.
Once I cleaned removed tabs/spaces, my issue was resolved.
philipxy
14.8k6 gold badges39 silver badges82 bronze badges
answered Oct 23, 2015 at 13:40
Double check the fields in the relationship the foreign key is defined for. SQL Server Management Studio may not have had the fields you wanted selected when you defined the relationship. This has burned me in the past.
answered Jan 6, 2014 at 19:27
- run sp_helpconstraint
- pay attention to the constraint_keys column returned for the foreign key
philipxy
14.8k6 gold badges39 silver badges82 bronze badges
answered Apr 12, 2014 at 16:20
In my case, I was inserting the values into the child table in the wrong order:
For the table with 2 columns: column1
and column2
, I got this error when I mistakenly entered:
INSERT INTO Table VALUES('column2_value', 'column1_value');
The error was resolved when I used the below format:-
INSERT INTO Table (column2, column1) VALUES('column2_value', 'column1_value');
answered Sep 12, 2020 at 6:45
The problem was reproducible and intermittent for me using mybatis.
I had correct DB configuration (PK, FK, auto increment etc)
I had correct order of insertions (parent records first); in debug I could see the parent record inserted with respective PK and just after that next statement failed with inserting the child record with the correct FK inside.
The problem was fixed by reseeding identity with
DBCC CHECKIDENT ('schema.customer', RESEED, 0);
DBCC CHECKIDENT ('schema.account', RESEED, 0);
The code that failed before started to work.
philipxy
14.8k6 gold badges39 silver badges82 bronze badges
answered Apr 28, 2021 at 22:12
MikeMike
19.8k25 gold badges97 silver badges138 bronze badges
I used code-first migrations to build my database for an MVC 5 application. The seed method in my configuration.cs file was causing the issue, creating a table entry for the table containing the foreign key before creating the entry with the matching primary key.
philipxy
14.8k6 gold badges39 silver badges82 bronze badges
answered May 14, 2014 at 19:12
Paulie22Paulie22
1111 gold badge1 silver badge9 bronze badges
The error you’re encountering is due to a violation of the FOREIGN KEY constraint FK_Sup_Item_Sup_Item_Cat
when attempting to insert a value into the client_id column of the sup_item table. The error message indicates that the value you’re trying to insert does not exist in the referenced table Sup_Item_Cat in the dev_bo database.
To resolve this issue, you should ensure that the value you’re inserting into the client_id column matches an existing value in the referenced table Sup_Item_Cat. You can verify the available values in the Sup_Item_Cat
table and make sure you’re providing a valid client_id.
Here’s an example query to retrieve the existing client_id values from the Sup_Item_Cat table:
SELECT client_id
FROM dbo.Sup_Item_Cat;
Review the output of this query and confirm that the value you’re trying to insert into the client_id column exists in the Sup_Item_Cat
table.
To identify which other tables and columns a particular table depends on, you can use the information from the Keys folder and Depends on dbForge Studio for SQL Server.
answered Jun 22 at 15:18
1
I experienced same issue while running the query:
INSERT INTO [dbo].[work_flow_actions] ([work_flow_id] ,[actions_id]) VALUES (70004, 150044)
Meanwhile, I confirmed that the values 70004 and 150044 exist in the corresponding tables.
I fixed this by including the database name as follows:
INSERT INTO [TIS].[dbo].[work_flow_actions] ([work_flow_id] ,[actions_id]) VALUES (70004, 150044)
answered Jun 28 at 1:11
Error: System.Data.SqlClient.SqlException: The INSERT statement conflicted with the FOREIGN KEY constraint «FK__Item__order__3AE27131». The conflict occurred in database «pmall», table «dbo.ItemSaved», column ‘id’.
Here’s my table:
ItemSavedUnits
- id
- ItemID (is set in this table a FK to Item.id)
- …etc.
Here’s my insert statement:
insert into ItemSavedUnits (ItemID, name, Price)
select ItemID, name,Price
from ItemUnits where ItemID = 92439
I don’t really understand why if I a FK constraint on ItemSavedUnits.ItemID that is related to Item.ItemID and ItemUnits has no constraints at all why I’m getting a problem inserting into ItemSavedUnits. The ItemID I’m tryign to insert does exist in the Item table.
asked Dec 1, 2009 at 19:38
PositiveGuyPositiveGuy
46.5k110 gold badges304 silver badges471 bronze badges
1
Are you absolutely sure that ItemId 92439 exists in the Item table, and not just in ItemUnits?
or
Is your select statement returning null?
answered Dec 1, 2009 at 19:40
7
It looks like you need a row in ItemUnits with that ID first — what does the SELECT statement part of your insert return? No rows?
Also, is there a trigger on the ItemSavedUnits table that could be causing problems?
answered Dec 1, 2009 at 19:43
SqlRyanSqlRyan
33k33 gold badges114 silver badges198 bronze badges
Your foreign key constraint violation doesn’t appear to deal with the ItemSavedUnits
table — the violation exception is being thrown by the constraint on the ItemSaved
table, not the ItemSavedUnits
table. Is there a trigger on ItemSavedUnits
that’s trying to insert into ItemSaved
?
answered Dec 1, 2009 at 19:45
DathanDathan
7,2663 gold badges27 silver badges46 bronze badges
- Remove From My Forums
-
Вопрос
-
Здравствуйте, делаю проект с использованием EF. И он выдает ошибку
Конфликт инструкции INSERT с ограничением FOREIGN KEY «FK_dbo.Attachments_dbo.NotificationEFs_AttachmentId». Конфликт произошел в базе данных таблица «dbo.NotificationEFs», column ‘newId’.Выполнение данной инструкции было
прервано.»}Вот сам код
var entity = ParserNotificationTender.GetNotifycationEntity(f); var placingway = ParserNotificationTender.GetPlacingWayEntity(f); var etp = ParserNotificationTender.GetETPEntity(f); var attachments = ParserNotificationTender.GetAttachmentEntity(f); printform.Notification = entity; placingway.Notify = entity; etp.NotifyEtp = entity; foreach (var attachment in attachments) { attachment.notifyId = entity; if (attachment.CryptoSignObg != null) { attachment.CryptoSignObg.AttachmentNotify = attachment; listCryptosign.Add(attachment.CryptoSignObg); } } if (entity != null) { listIntity.Add(entity); listPrintForm.Add(printform); lispPlacingWay.Add(placingway); listETP.Add(etp); if (attachments != null) { listAttachment.Add(attachments); } }
Далее вызывается этот метод
public static void AddCryptoSign(List<CryptoSignsAttachment> cryptosignrange) { using (var context = new DBEntity()) { foreach (var obj in cryptosignrange) { context.CryptoSignObj.Add(obj); context.SaveChanges(); } } }
и в нем как раз эта ошибка происходит, причем всегда во второй итерации.
-
Перемещено
11 января 2015 г. 12:46
-
Перемещено
Ответы
-
Ошибка связана с тем, что у вас вводится значиние которое отсуствует в свяной таблице (на которое указывает внешний ключ). Т.е. одному из полей сушности назначается неверное значение. Вам надо или задать его правильно или снять ограничение
внешнего ключа с таблицы.
Сделаем содержимое сообщества лучше, вместе!
azhty 0 / 0 / 0 Регистрация: 10.03.2017 Сообщений: 4 |
||||
1 |
||||
22.05.2017, 21:17. Показов 37360. Ответов 28 Метки нет (Все метки)
Конфликт инструкции INSERT с ограничением FOREIGN KEY «FK_komnaty_klienty». Конфликт произошел в базе данных «Gostinitca», таблица «dbo.klienty», column ‘Kod_klienta’.
0 |
359 / 286 / 76 Регистрация: 21.06.2016 Сообщений: 1,115 |
|
22.05.2017, 22:09 |
2 |
Ну скорее всего добавляете запись, которой не существует в таблице, на которую ссылается внешний ключ.
0 |
642 / 526 / 324 Регистрация: 20.05.2015 Сообщений: 1,464 |
|
23.05.2017, 09:35 |
3 |
Судя по всему код клиента хоть и первичный ключ, но не автоинкриминтируемый(если это так его либо надо прописывать вручную, либо выставлять автоинкремент на стороне базы).
0 |
3 / 3 / 0 Регистрация: 13.10.2016 Сообщений: 48 |
|
29.01.2018, 13:00 |
4 |
Ну скорее всего добавляете запись, которой не существует в таблице, на которую ссылается внешний ключ. А можно ли как-нибудь разрешить ссылаться на несуществующую запись?
0 |
359 / 286 / 76 Регистрация: 21.06.2016 Сообщений: 1,115 |
|
29.01.2018, 14:15 |
5 |
Leslov, Вариантов у Вас несколько.
0 |
3 / 3 / 0 Регистрация: 13.10.2016 Сообщений: 48 |
|
29.01.2018, 14:45 |
6 |
hoolygan, то есть, если и ссылаться, то только на уже существующую запись в таблице? Допустим есть две таблицы: Documents (D) и Organizations (O). Одно из полей таблицы D ссылается на первичный ключ таблицы O. В качестве первичного ключа выступает GUID, причем не генерируемый автоматически, он всегда указывается явно при добавлении записи в таблицу.
0 |
648 / 582 / 171 Регистрация: 17.07.2012 Сообщений: 1,661 Записей в блоге: 1 |
|
29.01.2018, 15:49 |
7 |
Leslov, так делать нельзя, ибо это приводит к неконсистентности данных в БД. Либо заливайте все данные в транзакции, либо создавайте пустые записи в связанной таблице, и потом уже заполняйте все поля при помощи UPDATE/MERGE
1 |
11539 / 7883 / 1200 Регистрация: 21.01.2016 Сообщений: 29,589 |
|
29.01.2018, 16:10 |
8 |
Leslov, внешний ключ имеет право ссылаться ни на что (null). Для этого его нужно создать со специальной настройкой.
0 |
648 / 582 / 171 Регистрация: 17.07.2012 Сообщений: 1,661 Записей в блоге: 1 |
|
29.01.2018, 16:20 |
9 |
внешний ключ имеет право ссылаться ни на что (null). Для этого его нужно создать со специальной настройкой. Ну ссылаться ни на что (NULL) и ссылаться на несуществующий PK — разные вещи.
0 |
11539 / 7883 / 1200 Регистрация: 21.01.2016 Сообщений: 29,589 |
|
29.01.2018, 16:30 |
10 |
Cupko, я это понимаю и мой совет этому не противоречит.
0 |
Leslov 3 / 3 / 0 Регистрация: 13.10.2016 Сообщений: 48 |
||||
12.02.2018, 12:41 |
11 |
|||
Нашел решение, подойдет для тех, кто использует миграции для обновления БД. Перед применением изменений нужно изменить файл миграции дописав строчку
где
0 |
11539 / 7883 / 1200 Регистрация: 21.01.2016 Сообщений: 29,589 |
|
12.02.2018, 14:04 |
12 |
Leslov, вы осознаёте эффект от работы
0 |
3 / 3 / 0 Регистрация: 13.10.2016 Сообщений: 48 |
|
12.02.2018, 14:16 |
13 |
Usaga, нет. Какие-нибудь подводные камни?
0 |
11539 / 7883 / 1200 Регистрация: 21.01.2016 Сообщений: 29,589 |
|
12.02.2018, 14:17 |
14 |
Leslov, так вы отключаете проверку ограничения при вставке и обновлении данных, что легко приведёт к повреждению данных. Не надо так делать. Это для самых запущенных случаев, когда по другому просто никак.
0 |
3 / 3 / 0 Регистрация: 13.10.2016 Сообщений: 48 |
|
12.02.2018, 14:47 |
15 |
что легко приведёт к повреждению данных. Можно какой-нибудь простой пример? Пока планирую использовать этот вариант, т.к. более изящного решения не нашел.
0 |
11539 / 7883 / 1200 Регистрация: 21.01.2016 Сообщений: 29,589 |
|
12.02.2018, 14:54 |
16 |
Leslov, какой пример? Записи несуществующего идентификатора?)
более изящного решения не нашел. Изящное решение простое: записывать данные, когда все зависимости в базе уже существуют.
0 |
3 / 3 / 0 Регистрация: 13.10.2016 Сообщений: 48 |
|
12.02.2018, 15:35 |
17 |
Usaga, хорошо. Приведу пример. Что бы вы изменили в этом примере?
0 |
11539 / 7883 / 1200 Регистрация: 21.01.2016 Сообщений: 29,589 |
|
12.02.2018, 15:43 |
18 |
Что бы вы изменили в этом примере? Я бы восстанавливал весь граф зависимостей ДО сохранения в базу, раз есть такая техническая возможность. Т.е. лез бы в базу, смотрел наличие в ней необходимых зависимостей и, в случае наличия, сохранял бы или запрашивал недостающее, сохранял, а потом уже заносил остальное. Т.е. в любой момент в базе были бы корректные данные.
0 |
3 / 3 / 0 Регистрация: 13.10.2016 Сообщений: 48 |
|
12.02.2018, 15:48 |
19 |
А как быть в случае если будут проблемы с сервером, например отсутствие ответа на запрос? Не сохранять документ без организации и выводить пользователю частичные данные? Тем более если это будет случай, когда отсутствие данных об организации менее критично, чем отсутствие какого-либо документа в базе.
0 |
11539 / 7883 / 1200 Регистрация: 21.01.2016 Сообщений: 29,589 |
|
12.02.2018, 15:50 |
20 |
А как быть в случае если будут проблемы с сервером, например отсутствие ответа на запрос Тогда данные сохранять нельзя, ибо они неполные и тупо повреждённые. За вами выбор: информировать пользователя или молча повредить данные и в базе.
0 |