[thelist] Calling a sproc from VB

Anthony Baratta Anthony at Baratta.com
Mon Feb 2 17:18:36 CST 2004


At 10:05 AM 2/2/2004, Tab Alleman wrote:
>I'm calling a SQL2k Procedure from a VB app, and I'm not getting the
>expected change in my Output parameter.  Here are some relevant code
>snips:

The problem is in your stored, me thinks:


>SELECT @ResultStr = 'Beginning procedure'

This will not return any info. In order to return this you should try 
something like this:

         SET @ResultStr = 'Blah Blah Blah'
         SELECT @ResultStr

OR

         SELECT 'Blah Blah Blah' as ResultString

That should return something.

P.S. I normally don't set return values directly in the CREATE part of the 
statement. No reason except I'm a lazy coder and have found no reason to do 
it (e.g. it hasn't bitten me in the butt yet not to do it) - it's probably 
the better way to do it. So you might even get a way with just a set statement.



More information about the thelist mailing list