MS SQL - insert data from one Table into another using Trigger

时间:2019-03-06 11:40:09

标签: sql sql-server

I have few data's in Table_1 & want to insert the data into Table_2.

Is it possible to perform this operation using Trigger function in MS SQL?

Also I want this to data to insert into table_2 automatically in a specific time.

Can this be performed using SQL Trigger?

New to SQL...

1 个答案:

答案 0 :(得分:0)

也许可以使用代替触发器?

class CustomLabelEncode(BaseEstimator, TransformerMixin):
    def fit(self, X, y=None):
        return self
    def transform(self, X):
        return LabelEncoder().fit_transform(X);

请注意,尽管您要“覆盖”标准CREATE TRIGGER [schema_name.] trigger_name ON {table_name | view_name } INSTEAD OF {[INSERT] [,] [UPDATE] [,] [DELETE] } AS {sql_statements} ,但必须在触发器的两个表中插入。