In SQLCLR, I can detect if I'm inside an SqlContext, and if so, perform additional functions like writing to the pipe.
However, how do I detect if I'm inside a read-only SQL context, such as method with this attribute:
[SqlFunction(DataAccess = DataAccessKind.Read)]
public static void MyMethod()
{
}
The only way I can surmise is to walk back the stack and look for a method decorated with SqlFunctionAttribute?