Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Retriving data IN SQL SERVER 2000


Retriving data IN SQL SERVER 2000

Author
Message
bosekolli
bosekolli
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 4
my name is BABU i have requirement like this any body can help me?

i have a table name emp with 10000 records and without identity column i want first 5000 records after i want 5000 to 7000 records later 7000 to 10000 is it possible in sql server?
Ian Yates
Ian Yates
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1056 Visits: 445
Hmmm - you've posted this to the wrong forum.

In any case, what do you mean by you "want" the records?

Do you want the first 5000 records to have some flag set, then the next 2000, etc? Or do you want to be able to return them in a query?

In either case, how do you define "first"? You'll need to work out how you want to order the data. This could be by date, name, colour, size, etc, etc depending on what attributes you have for your data. Now that I look again you have employees (the "emp" name is usually for this?) so I suppose name, hire date, salary, etc could be reasonable criteria.

Are you actually running SQL 2000 or did you just post this question in a forum with 2000 in the name? There are easier ways to do this in 2005...



Jeff Moden
Jeff Moden
SSC-Forever
SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)

Group: General Forum Members
Points: 45018 Visits: 39887
bosekolli (2/23/2008)
my name is BABU i have requirement like this any body can help me?

i have a table name emp with 10000 records and without identity column i want first 5000 records after i want 5000 to 7000 records later 7000 to 10000 is it possible in sql server?


The answer to both questions is "Yes". Like Ian stated, though, we need just a wee bit more info... Are you in fact using SQL Server 2000 or 2005? Can you post the CREATE statement for the EMP table? In the absense of an IDENTITY column, what is the Primary Key of the table? And, last but not least, what order to you want the results to be sorted by?

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
Although they tell us that they want it real bad, our primary goal is to ensure that we dont actually give it to them that way.
Although change is inevitable, change for the better is not.
Just because you can do something in PowerShell, doesnt mean you should. Wink

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search