Foxpro server sql updating
As said it depends on something else to order by anyway.
I can understand you want a permanent Line Seq number if customers should be able to refer to a line item by its number and you want to uniquely identify this lineitem by the invoice number and Line Seq, so it's not a wrong demand, but it should be assigned while creating line items.
When the table has stored an invoice with two line items and you introduce a third in the editing, but sort that third item into second position, you could get in trouble, if you save the new record with Lin Seq=2, before updating the old line item with Lin Seq=2 to its new Lin Seq=3 position.
The solution for that is to store negative Lin Seq numbers with each save and then do an UPDATE turning all negative Lin Seq positive in an After Save method.
If you wanted to use Tamars SQL on the crs Line Items loaded buffered, you have to take special care to make use of VFP9s WITH (buffering=.t.) clause, to go through all records of crs Line Items.
So Tamars update-SQL only is good for the sequential numbering after the fact of storing line items, or for populating Lin Seq after introducing the Lin Seq column. If you establish a database table rule for uniqueness of (invoiceid,linseq), to never have double line sequence numbers for an invoice stored, even not just temporary, you get an update problem.
Its probably trying to complain about the "fred...drugnote" part.
Dear Team, I have an invoice line items table in which I want to update a column ('Line Seq') for an invoice (ie there could be multiple records in this table for a single invoice) with serials numbers from 1, ie 1,2,3,4... But sometimes, the sequence need to be generated according to an index tag. Rajesh There are no such things as MSSQL ROW_NUMBER() OVER PARTITION BY... So it's unfortunate if you don't set these Line Seq numbers to start with.
There is a finger tech application that record finger attendance and other application is based CRM.
However, is there a way to accomplish this using an SQL statement? If the latter, you could simply set the number to equal the record number: Thank you for your thoughts dear Mike. Generally, RECNO() should help as the column is used to save in which order the records were added in the invoice and to display them later in the same sequence. That will help me at a time when I need to re-write the application in Dot Net platform. I also don't see a way to do this with SQL, but even if, this mechanism already depends on being able to define an order of line items, a line sequence, to start with (the ORDER BY clause of the T-SQL partitioning).
Or is it enough for each number to be unique within the table? However, I am curious to know if there is way through SQL.
Needing to post process numbering is a bad concept itself.
Notice the Row_Number() mechanism in T-SQL also doesn't attach that number permanently on each lineitem, it's always doing a temporal numbering just valid in the query result.
I want to delete this record, so I am usingdelete from fred...drugnote where cast(dntcode as nvarchar(255))='ANPE1'but I get the following error OLE DB provider "VFPOLEDB" for linked server "fred" returned message "Multiple-step OLE DB operation generated errors. If you're not comfortable with faith-based sql, followup with a SELECT to confirm success.