Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SPT equiv of RECNO in SQL Server & use no. in the tempta
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
Database:
MS SQL Server
Miscellaneous
Thread ID:
01155452
Message ID:
01155461
Views:
20
>Hi I have a SQL statement in VFP which I am to convert to SQL Server SPT
>
>SELECT localcursor.*, RECNO() AS record FROM localcursor INTO CURSOR localcursor
>
>previously I have already created a temptable for this localcursor's original fields (the ones that are being *ed in this statement).
>
>In short I have a temptable in SQL Server, now I have to add this RECNO() equiv. field in the temptable.
>
>Is there any way to go about it.

There is no such a term like Record number in SQL Server. All resultSets comes with the order you specify in select. If you didn't specify an order in most cases they come with Natural order BUT you can't relay on this. If you have some DELETE and INSERTS SQL Server uses the palces of Deleted records and record there newly created ones, so the resultset will come scrambled.
If you want something like record number out an identity field in the table and use it.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform