• When I attempt to run the CREATE TABLE statements you posted, I get a ton of errors. Please create an empty database, run the code yourself, and fix all errors, then post the corrected code.

    I am happy to spend my time to fix problems you are experiencing, but I refuse to waste my time on fixing simple things like foreign keys to other tables that you can easily check and remove yourself.


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/