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.
| Author |
Topic |
|
yosiasz
Master Smack Fu Yak Hacker
1635 Posts |
Posted - 2011-07-21 : 19:33:53
|
| GreetingsGiven a certain task assignment table how could I go about bulk assigning tasks to all users evenly? I tried cross apply to users with row_number() over ... but that exploded the result set. So what I would like to do is see how many rows there are, divide by number of users and then assign task based on row number ranges?How would I go about doing something like that? Let me gather some sample data as you chew on thatGraciasIf you don't have the passion to help people, you have no passion |
|
|
Vinnie881
Master Smack Fu Yak Hacker
1231 Posts |
Posted - 2011-07-21 : 22:28:07
|
| BAHAHA, I needed to edit and delete what I posted, I apparently didn't read what you requested at all!If you want, post some sample data and I'll try to give you an example if you are still having issues. |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-07-21 : 22:35:37
|
check out ntile(). Think this is what you wanted KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
yosiasz
Master Smack Fu Yak Hacker
1635 Posts |
Posted - 2011-07-22 : 10:52:43
|
| YES !!! NTILE is a beauty got it working!Thanks very much!If you don't have the passion to help people, you have no passion |
 |
|
|
|
|
|