I have this data stored in the SQL Server
How can I delete the first three rows by calling the row number found in the left (1,2,3)?
CodePudding user response:
You can't. That row number is not tangible and is nothing more than the order the results were returned in. SQL does not guarantee order of data, so there is no rule that says if you run the same query 20 times, you'll get the same results at 1,2, and 3 each time. That's not to say you won't get them same results, they're just not guaranteed. You need to delete using a column that actually exists as part of the table definition, such as F1, F2, etc...
As others have suggested in the comments, try to clean up the data before you import it into SQL Sever. You have a few options.
- Delete the rows from the file before importing.
- Configure the Import Wizard correctly to exclude those rows.
Helpful link