+2  A: 

Don't.

Managed threads <> native threads.

The only option supported for managed threads is to call Thread.BeginThreadAffinity/EndThreadAffinity around code which requires thread affinity.

Damien_The_Unbeliever
Actually the CLR maps managed thread to native thread, but that's an implementation detail that may change.
Brian Rasmussen
CLR inside SQL server doesn't. So that's an implementation detail that even today isn't necessarily true
Damien_The_Unbeliever
@Damien: Good point. I guess I was being too focused on the plain vanilla CLR.
Brian Rasmussen
+3  A: 

Can't you use Thread.BeginThreadAffinity?

Brian Rasmussen
A: 

I found an example on using this function here.

treaschf