Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 trigger how to add values

Author  Topic 

programer
Posting Yak Master

221 Posts

Posted - 2013-09-19 : 15:22:45
Hi,

I need to add:
Insert into tbl_BetSlipSystem(BetSlipDetailId,BetSlipEventId,SystemBet)
Select BetSlipDetailId,Id from
(Select row_number() over(order by id) as Number, Id,BetSlipDetailId from inserted) as a
Where a.Number IN (1,2, 3)


SystemBet=1

Because this is not values from inserted I would like to ask how to do it?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2013-09-19 : 16:39:33
Select BetSlipDetailId,Id,1 from
(Select row_number() over(order by id) as Number, Id,BetSlipDetailId from inserted) as a
Where a.Number IN (1,2, 3)

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

programer
Posting Yak Master

221 Posts

Posted - 2013-09-19 : 17:51:50
thanks

quote:
Originally posted by tkizer

Select BetSlipDetailId,Id,1 from
(Select row_number() over(order by id) as Number, Id,BetSlipDetailId from inserted) as a
Where a.Number IN (1,2, 3)

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/

Go to Top of Page
   

- Advertisement -