SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2012 Forums
 Transact-SQL (2012)
 send multiple messages from trigger
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

MCPieters
Starting Member

Netherlands
3 Posts

Posted - 02/26/2014 :  05:04:30  Show Profile  Reply with Quote
Hi,

I am using service broker to send messages from triggers.
Now when I insert many records at once in the table with the trigger, I want to send the inserted records from trigger in batches.
like I inserted 1 million records and now I want to send these records in batches of 250.000. I tried to use row_number() over() but I get an error, I think I cannot number the records of the table inserted(inside the trigger).

Does anyone has a solution?

Robowski
Posting Yak Master

101 Posts

Posted - 02/27/2014 :  06:39:46  Show Profile  Reply with Quote
quote:
Originally posted by MCPieters

Hi,

I am using service broker to send messages from triggers.
Now when I insert many records at once in the table with the trigger, I want to send the inserted records from trigger in batches.
like I inserted 1 million records and now I want to send these records in batches of 250.000. I tried to use row_number() over() but I get an error, I think I cannot number the records of the table inserted(inside the trigger).

Does anyone has a solution?



Create a staging table and place the inserted records only in there with an identity column and a second process to take the records from there and send in batches that way?
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.17 seconds. Powered By: Snitz Forums 2000