5
Answers

SQL query execution timings

I am not getting the reason why query 1 is taking 10 seconds,query 2 and query 3 taking 1 second to execute even if they are same only order is different
 
1.SELECT TOP 10000 * FROM tbl1
WHERE
len(empid) = 4 and
isnumeric(empid) = 1   ORDER BY empid desc
2.SELECT TOP 10000 * FROM tbl1
WHERE
len(Employee_ID) = 4 and
isnumeric(empid) = 1 
 
3.SELECT TOP 10000 * FROM tbl1
WHERE
len(empid) = 4 and
isnumeric(empid) = 1 ORDER BY empid
 
Answers (5)
0
Roei Bar

Roei Bar

NA 7.8k 0 15y

hey, i would recommend you to change your work, to work with CheckedListBox
you will have a CheckedItems Property in this, and the Value is the text in it, and if you want complex Object with multiple properties, you can have an object, and on the build just do an Override on the ToString for the displayed item Text and once you run all all Checked Items, you will have the ItemId, and by ItemId you can get any property in the ListView