Results 1 to 9 of 9
  1. #1
    Join Date
    Dec 2003
    Posts
    18

    Unanswered: query using the record number

    happy friday...
    my table has 200,000 + records and I want to see the particular record which I think it is causing the problem.
    How could i query 195,203rd record?
    thank you, yanoroo

  2. #2
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    What problem is it causing? How did you figure out the number to begin with?
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

  3. #3
    Join Date
    Dec 2003
    Posts
    18
    Quote Originally Posted by rdjabarov
    What problem is it causing? How did you figure out the number to begin with?
    oh, the record number is just an example.
    actual case is -I ran dts package to import data from txt file to sql table.
    The dts truncated the table and imported the records correctly (218503 record) but I can't find the data from 208775th record on the table....
    I want to see the what was populated into the table from 208775th record.
    And strange thing is the table has 237043 record (which is more than input)

  4. #4
    Join Date
    Sep 2003
    Location
    New York, NY
    Posts
    136
    are you getting 237043 by doing a count(*) on the table?

  5. #5
    Join Date
    Dec 2003
    Posts
    18
    Quote Originally Posted by rohitkumar
    are you getting 237043 by doing a count(*) on the table?
    yes, it is by count(*) on the table.

  6. #6
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    If you are just debugging the process, then temporarily create an incrementing identity column on the table.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  7. #7
    Join Date
    Dec 2003
    Posts
    18
    Quote Originally Posted by blindman
    If you are just debugging the process, then temporarily create an incrementing identity column on the table.
    Hello,

    Found out the problem was DTS prod installation error.
    Thank you anyway for your suggestion.
    Yanoroo

  8. #8
    Join Date
    Feb 2004
    Location
    San Antonio, TX
    Posts
    565
    i suggest in a situation like this to create a staging table when you transfer large amounts of data to an sql server. this way you can set the error count high and allow sql server to leave the rows causing the error in the staging table while you move the clean data to the final destination. you can then have the dts send you an email notifying you of the prob and you can clean those rows in the morning.

    go to www.SQLDts.com

  9. #9
    Join Date
    Oct 2003
    Posts
    83
    I assume there is an unique field named pid in your table and you are looking for a particular record of pid(in this case 195,203rd).You can try this query--

    select * from mytable where pid not in
    (select top 195,202 pid from mytable)

    If you have any other type of requirement that can be solved too.
    Subhasish

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •