May 5, 2006 at 11:39 pm
Hi All,
I need to know, is there any alternative of Oracle ROWID in SQL Server.
Best Regards,
Zaheer
May 6, 2006 at 4:02 pm
ROWID has no equivalent. ROWNUM can be simulated and the above link gives you some of those options.
May 8, 2006 at 12:47 am
Thanks Guys,
Actually I neet to do paging in ASP.NET application. I have created a Stored Procedure, which takes two parameters(@From, @To). I don't want to use primary key column, because there might be some missing values in primary key column.
Therefore I need to access records by its position rather than its value like (1 to 15 , 20 to 35 etc.)
Regards,
Zaheer
May 8, 2006 at 7:04 am
Maybe a temporary table or table variable with an identity column would suit your needs. Insert the whichever with an order by clause in your query, then select the rows using your range. This gives the idea:
declare @ctr bigint ; select @ctr = 1
declare @t1 table (
rownum bigint identity(1,1),
col1 bigint
)
while @ctr < 100000
begin
insert @t1
select @ctr
select @ctr = @ctr + 1
end
select * from @t1
order by rownum
I hope this helps.
George
May 8, 2006 at 7:45 am
In ASP.NET the pagination is not driven off of your primary key, if you are binding your dataset to a datagrid you need to set two options for implementing the pagination, SET your pagesize to 15(desired value) and SET AllowPaging to true and write a simple logic to set the current page value and for navigating to the nextpage.
Prasad Bhogadi
www.inforaise.com
May 8, 2006 at 3:48 pm
Prasad is right. Do it in .Net - much easier and faster!
May 8, 2006 at 9:28 pm
Interesting...
I may have a method that might even beat ASP.Net for performance but I need to know, does your table have an auto-numbering IDENTITY column? And, it doesn't matter if it may be missing values... just that an IDENTITY column is present...
--Jeff Moden
Change is inevitable... Change for the better is not.
May 8, 2006 at 10:41 pm
Again Thanks Guys
Actually I am using Repeater Control instead of Datagrid control, which doesn't have buitin paging option.
Well Jeff, my table doesn't have an auto-numbering IDENTITY column but unique column it has.
I have already used Overloaded Fill(dataset, startRecord, maxRecords, srcTable) method of SqlDataAdapter object and its working fine. But I need to improve preformance as using this method I have to write query like this Select * from Customers, which returns all records.
Please let me know it you know any way.
Regards,
Zaheer
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply