If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Microsoft SQL Server > Paging Stored Procedure

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #16 (permalink)  
Old 11-05-09, 23:03
petalyaa petalyaa is offline
Registered User
 
Join Date: Nov 2009
Location: Selangor, Malaysia
Posts: 5
Thanks blindman. I did analyze back my query and try to simplify it. Then i come to this short query. But, by default, Java will throw exception with this query because it took about 5 minutes to execute and sql server will response, server timeout. Then i try to set query timeout to unlimited with PreparedStatement object. Then, hey it work!!

Code:
SELECT TOP x * FROM (SELECT TOP [x*y] * FROM VPCSTINV AS T1 ORDER BY NAME DESC) AS T2 ORDER BY NAME ASC

x = Number of result to show
y = current page
Thanks all!! Cheers..
Reply With Quote
  #17 (permalink)  
Old 11-09-09, 10:40
blindman blindman is offline
World Class Flame Warrior
 
Join Date: Jun 2003
Location: Ohio
Posts: 11,726
It is the job of your interface to determine how the data is displayed. The database has nothing to do with it.
__________________
If it's not practically useful, then it's practically useless.

blindman
www.chess.com: "sqlblindman"
Reply With Quote
  #18 (permalink)  
Old 11-09-09, 20:38
petalyaa petalyaa is offline
Registered User
 
Join Date: Nov 2009
Location: Selangor, Malaysia
Posts: 5
Yeah, correct.. This must be done in the interface and nothing to do with database. U have to query your sql first and then get the title, write it in the page and add
Code:
JAVA
<a href="<%= link %>"><%= name %></a>

PHP
<a href="<?php echo $link ?>"><?php echo $name ?></a>
Reply With Quote
Reply

Tags
paging, sql2000, stored proc, substring

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On