>It is very strange. This should not fail unless there are some issues accessing SP using OLE DB provider. To prove this, can you just put
RETURN 9999
as the first line of NewId() SP?
>
Your question made me look closely at my test tables. I was assuming the NewID() function was causing the problems since I tested it on another table that didn't use it, and it worked just fine. In fact, it's the RI code that is causing the problem (surprise, surprise..."trigger failed" should have given me a clue ;-) ). It seems the RI code we use (which is based on the code from Steve Sawyer - the "Effective Techniques" book). It's using some commands that aren't supported in the OLE-DB provider. Specifically, RELEASE and SET ANSI. #DEFINE is also (supposedly) not supported, but that works inside of NewID(). As soon as I removed the Insert trigger, my .NET code worked.
Now, having done that, is there an easy way to get the new ID that was generated for this new record?