Fix Sql Server table types causing deadlock
Simply creating and declaring a table type will cause a deadlock.
create type dbo.udt_Days as table (
[Day] tinyint not null
declare @Days dbo.udt_Days;
Transaction (Process ID 52) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
Adminren (developer, rextester) commented
User code in rextester is run within a transaction which is rolled back. It seems this is unfixed bug in sql server: http://dba.stackexchange.com/questions/52900/can-i-create-a-user-defined-table-type-and-use-it-in-the-same-transaction , so probably can't do much about this one ,,,