Login failed for user 'foo' but the SQL executed correctly

From: Benjamin Joldersma (benj_at_theinsiders.com)
Date: 09/10/03


Date: 10 Sep 2003 14:53:14 -0700


Hello all,

I am having a strange issue, I am running an ASP.NET site, with
MSSQL2k back end. All but one of my procedures execute fine, and with
no errors. But one procedure in particular raises the Login failed
for user 'foo' error. The funny thing is, the procedure inserts
correctly.

I explicitly addded permissions to access the table and the procedure
to the user, even though the user is in the db_owner role. I am doing
a SELECT @@IDENTITY at the very end, but that hasn't caused me
problems in the past. any ideas anybody?

--ben