Filter on Output clause sql

前端 未结 1 1787
野性不改
野性不改 2020-12-18 02:13

I am trying to use a filter on an OUTPUT clause in t-sql.

What I want to do is something like this:

Insert into tbl_1(col1,col2)
Output Inserted.col         


        
相关标签:
1条回答
  • 2020-12-18 02:39
    insert into #tbl_temp
    select col1
    from
      (
        insert into tbl_1(col1,col2) 
        output Inserted.col1
        select col3, col4 
        from tbl_2
      ) as T
    where T.col1 > 0
    
    0 讨论(0)
提交回复
热议问题