Let me tell ya, TGIF!!! I'm burnt!!!

Here's my problem.
I'm running Perl 5.6 on a Linux/Apache Box talkin' to a W2K Box and SQL Server. I'm using FreeTDS as the go between and all things work well. That is until I realize I don't know MS SQL Server commands.

I have a program that connects to a MySQL DB and I use the LIMIT command that allows me to call the rows I want returned. You know, LIMIT 0,10 -- returns rows 1-10. I don't know how to do this in MS SQL. I know how to use SELECT TOP 10, but I want to return results in groups of ten. With LIMIT I can return 1-10, then 10-20 and so forth. Kinda speeds up the screen write in case someone chooses a search criteria that returns mega results. Does anyone know a Perl workaround?

Also, more of a DBI question - in MySQL I can Perl with
if ($sth->rows == 2)
And this lets me know if I've returned two rows or not. In the MS SQL it only tell me that if I have a return it equals -1. Does anyone know how to see how many rows return true?

Supa Thanx

peppiv



In reply to Perl DBI MS SQL Question by peppiv

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.