>>I am writing my first c/s app using VFP5 and SQL Server 6.5. My problem is this:
>>
>>I want to add, for an example, a new record into my customer table. My fox app contains a remote view containing all fields in the customer table, parameterised so that it fetches back only one record, any record. I then do an INSERT into the view, to insert the basic information, allowing my user to fill in the rest.
>>
>>I do not fill in the cust_id field, as this is automatically populated by SQL Server using IDENTITY. Therefore in my view it is zero (although the record that has just been added on the server has a cust_id). How do I find out the cust_id of the customer that I have just added?
>
>You need to query the server for the global variable
>
>@@identity
>
>Unfortunately this will mean two SQLs for every insert. I always specify what the id should be from the front end myself.
>
>Ian
Hi!
What about = REQUERY() directly after INSERT and m.Cust_Id = ViewName.Cust_id
Marat
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only