Aug 16, 2005 #1 abs2003 MIS Aug 31, 2004 80 US I don't know if this is possible. 1. select top 100 * from a table. 2. update field on a table as 'in-process' for all 100 records 3. pass those 100 records to my application. all this has to be done in stored proc. abs
I don't know if this is possible. 1. select top 100 * from a table. 2. update field on a table as 'in-process' for all 100 records 3. pass those 100 records to my application. all this has to be done in stored proc. abs
Aug 16, 2005 1 #2 gmmastros Programmer Feb 15, 2005 14,912 US It's possible. Create Procedure GetSomeData AS SET NOCOUNT ON Update MyTable Set MyField = 'In-Process' Where Idfield In (Select top 100 IdField From MyTable) Select Top 100 * From Mytable -George Strong and bitter words indicate a weak cause. - Fortune cookie wisdom Upvote 0 Downvote
It's possible. Create Procedure GetSomeData AS SET NOCOUNT ON Update MyTable Set MyField = 'In-Process' Where Idfield In (Select top 100 IdField From MyTable) Select Top 100 * From Mytable -George Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
Aug 16, 2005 Thread starter #3 abs2003 MIS Aug 31, 2004 80 US gmmastros, Thank you. Upvote 0 Downvote
Aug 16, 2005 #4 gmmastros Programmer Feb 15, 2005 14,912 US I should mention that you should put an order by in the top 100 queries to ensure you are getting the right data. Create Procedure GetSomeData AS SET NOCOUNT ON Update MyTable Set MyField = 'In-Process' Where Idfield In (Select top 100 IdField From MyTable Order By SomeField) Select Top 100 * From Mytable Order By SomeField -George Strong and bitter words indicate a weak cause. - Fortune cookie wisdom Upvote 0 Downvote
I should mention that you should put an order by in the top 100 queries to ensure you are getting the right data. Create Procedure GetSomeData AS SET NOCOUNT ON Update MyTable Set MyField = 'In-Process' Where Idfield In (Select top 100 IdField From MyTable Order By SomeField) Select Top 100 * From Mytable Order By SomeField -George Strong and bitter words indicate a weak cause. - Fortune cookie wisdom