How can I get a parameterized bulk version of a scalar C UDF to work in SQL?