I'm new to SQL Server and I wonder: I have built some tables that display the documents that produced in my program.
I need to write a stored procedure that inserts a document to the tables with transaction.
I think to create a main procedure with transaction that get 2 DTU of table: main and details
My question is: is it valid to create many DTU of table, for example: if in my DB their is 10 tables i need create 10 data type user of tables? How can I use polymorphism in the procedure parameter ,so I can write a one procedure that get for example: if i have 2 tables person and teachers that all teacher is person so my parameter will be alwase as person type but i allow send also teacher type ?
After I saw the XML
type but its more slowly to use that and also it is more difficult
I wonder if SQL Server has other solutions to write to multiple tables with one transaction that would require fewer parameters?
Thanks for advance and hope that you will help me