Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have successfully created an external content type to my SharePoint and I have made a list from it. The problem is my table has over 24000 records in it. I need to grab the last 2000 records and not the first 2000 records as it seems to be doing. Is there any way to run a query against the data I am getting to bring in the last 2000 items?

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

Why don't you create a Stored Procedure that brings the desired Last 2000 items for you, and create Read List Operation from Stored Procedure and rest from the table?

Stored Procedure can look like:

SELECT TOP 2000 columns FROM table
ORDER BY id_column

I hope this will work!

share|improve this answer
    
Ill give it a shot. I am sure that is what I need to do. I am just new at this :) I have never had to deal with anything SQL related with SharePoint until 2010. It is good to learn new things. –  lazoDev Nov 12 '12 at 13:10
    
Yeah please try that, and yes it always good to learn new things ;) –  Arsalan Adam Khatri Nov 12 '12 at 14:58
    
I cannot seem to get SPD to find my Stored Procedure. I have went through the tutorial blogs.msdn.com/b/sharepointdev/archive/2011/02/10/…; here and I have been unable to get it to show up in my routines. I love how frustrating SharePoint canbe sometimes. –  lazoDev Nov 12 '12 at 20:12
    
Fixed it! My problem was the way I was accessing the database. I think my default permissions where not allowing me to see the stored procedures I created. NOOB mistakes all around today :) –  lazoDev Nov 12 '12 at 20:33
    
you are learning, so no problem :) –  Arsalan Adam Khatri Nov 12 '12 at 20:37
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.