Apparently, someone else was poking around in the database at the time, and you managed to clash with that process. What that may be, I don't know. But it is not your ALTER TABLE statement, assuming that the two statements above are part of the same SQL script. Statements in a script are runt perfectly sequentially.
You can use this query to extract information about deadlocks on your instance. You may to change the path for the query to run. (The folder should be the same as for the SQL Server errorlog).
SELECT CAST(event_data AS xml), timestamp_utc
FROM sys.fn_xe_file_target_read_file(
N'C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\LOG\system_health*.xel',
DEFAULT, DEFAULT, DEFAULT)
WHERE object_name = 'xml_deadlock_report'
ORDER BY timestamp_utc DESC
Hi!
Thanks a lot for your answer.