开发者

SQL proc executes but nothing is inserted into the table

开发者 https://www.devze.com 2023-01-17 00:53 出处:网络
I have a vb.net app using plain old ado.net to run a s\'proc on the database server.The proc simply inserts a record that contains binary data.

I have a vb.net app using plain old ado.net to run a s'proc on the database server. The proc simply inserts a record that contains binary data.

When this executes, I can see the exec call on the proc being made from within sql profiler.

ado.net claims everything worked, no errors. However, a record isn't inserted. There are no key collisions or anything like that.

I copied the query I saw from profiler and ran it directly within management studio. When I 开发者_如何学Pythonrun it there, the record is inserted.

I have no idea what to even check next. Thoughts?


Found the answer. I'd go ahead and delete this but I'm sure I'll forget someday and run into the same problem.

For whatever reason, sql server and ado.net were conspiring against me. The user account I was attempting to execute the s'proc under did not have execute rights for it. After I set those rights then it was proceeding as normal.

Now, the problem I have is that there should have been some type of warning, error, exception, whatever that said "hey, you can't do this" instead of simply saying "Everything is good" But that's a question for Microsoft.

Thanks all.


It was a security rights issue. See post.


without any code it is difficult to diagnose, but make sure you commit any open transaction, see: http://www.vb-helper.com/howto_net_db_transaction.html

0

精彩评论

暂无评论...
验证码 换一张
取 消