I am running a sql query
INSERT INTO Items(ID,Name) VALUES (1,'test')
INSERT INTO ItemsExtended(LanguageId,ItemId,IsMain,Name,IsVerified) VALUES (1,1,1,'test',1)
the first statement fails with:
[Err] 23000 - [SQL Server]Violation of PRIMARY KEY constraint 'PK__Items__3214EC2766F4E086'. Cannot insert duplicate key in object 'dbo.Items'. The duplicate key value is (1).
01000 - [SQL Server]The statement has been terminated.
because of primary key, but the second statement runs twice. so there are 2 inserts instead of just one on the second insert. if the first statement does not fails the second statement inserts only once as it should. why does it happens? there are no triggers on the tables.
The problem was in navicat for some reason it executed it twice, running in sql server management studio worked just fine.