[thelist] SQL Server & Stored Procedures
Paul Cowan
paul at wishlist.com.au
Tue Oct 30 19:15:05 CST 2001
Hi Scott,
> it was long time ago, MSSQL Server 6.5, and has sat in my
> memory since.
> (We've not looked into it since MSSQL 7 came out)
<snip>
> Recommendations
> Expect different results as compared to earlier versions of
> SQL Server.
> For more information, see Functions.
Point taken! SQL 6.5 did.. well.. frankly... did a lot of weird shite, from
what I can gather.
> So @@rowcount isn't a server global variable anymore, its a system
> function. G'head and use it then =)
>
> (but do I mention IIS uses the same ODBC connection for multiple
> requests?)
Indeed... and as I said earlier, caution is well advised.
I guess I was also looking at it from our point of view, where every single
database entity is done via a stored proc, and hence has exclusive use of a
DB connection for the running of the proc.
So a hypothetical proc, proc_UpdateAuthors, which does
UPDATE Authors SET ...
RETURN @@ROWCOUNT
is fine... but
set rstBlob = cnnBlah.execute("UPDATE Authors...")
...
set rstBlob = cnnBlah.execute("SELECT @@ROWCOUNT")
is far from guaranteed to work. Yet another argument for code modularization
and encapsulation.
Paul
More information about the thelist
mailing list