Home > database >  SQL server to create a stored procedure, copy a table structure and add a trigger to be replicated t
SQL server to create a stored procedure, copy a table structure and add a trigger to be replicated t

Time:09-29

Requirements: store in the process of copying a table structure and add fields change_type and updatetime, and add a trigger to be replicated tables, triggers generated statement added to the new list
Example: there are [table A]
Generated in the process of storing the new table A_trigger [table], table A_trigger structure like A table and two more fields change_type and updatetime, table A generated increases trigger deletion, role
In table A_trigger

CodePudding user response:

According to syscolumns, syscomments, systypes dynamically generate the list of table structure, and bring the same default value
  • Related