On Fri, Jan 14, 2011 at 5:48 AM, Rafael Copquin <[email protected]> wrote:
> I want to write a SP in SQL Server, where I would send three parameters
> and get one result, like so:
>
> 1st param      a table name
> 2nd param    a field name in that table
> 3rd param     a value
>
> I would like to concatenate all three parameters inside the SQL SP to
> get something like this
>
> select (fieldname) from (table name) where (fieldname) = value
>
> and I would like to return that value to VFP.
>
> IOW, I want to create a stored procedure to be able to check the
> existence/non existence of a value in a table, to replace the seek
> command in VFP
>
> for instance
>
> select account from customers where account = 'RAF1234'
------------------

Are you looking to identify if this row exists in the db and if so
update it or add it if not?  Now you get to what an SP will do for
you.

You could pass in the values of the data row to the SP.

It can find it and update it or insert it

Then it could return the ID for you if you needed that.



-- 
Stephen Russell

Sr. Production Systems Programmer
CIMSgts

901.246-0159 cell

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to