You asked why I want to use an SP instead of simple VFP passthrough. The answer is: I don't know. I just read somewhere that stored procedures are "better" so, in my ignorance......
As for updating or adding to the table, that could be a possibility but then I would do that with a regular VFP statement. Unless you can suggest a better way. I'm just learning so I'm open to suggestions Rafael El 14/01/2011 12:39, Stephen Russell escribió: > 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. > > > _______________________________________________ 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.

