May 28, 2011 at 3:55 am
Dear Sir,
I have a Table given below in SQL DB & want to go record by record (Alive to Vinit) to these Table . How can I do ?
Employee ID Basic Salary Joining Date
Alive 10000 01/04/2009
Neel 20000 01/04/2010
Vinit 30000 1/04/2011
I want to do some process for every single record that's why I want to go row by row.How to achieve that ?
Kindly reply.
May 28, 2011 at 4:31 am
Im afraid that your question exposes the fact that you dont understand what an RDBMS is at a rather fundemental level.
You should not be thinking about going row-by-row.
Try this book
May 29, 2011 at 11:14 pm
I have a Temporary Table which has no of records (Rows) Now I want to go these Temp Table thru row by row. Is it Possible in SQL ???
May 30, 2011 at 1:38 am
subrata.bauri-1051938 (5/29/2011)
I have a Temporary Table which has no of records (Rows) Now I want to go these Temp Table thru row by row. Is it Possible in SQL ???
Please explain why you insist in dealing with one row at a time. What's the business case forcing it?
May 30, 2011 at 2:06 am
I'm designing a report which will give Production BOM Details Where I feel this requirement.
May 30, 2011 at 2:10 am
In SQL you should almost never iterate row-by-row. Nothing you've said so far indicates there's any need to do operations on individual rows.
What exactly are you trying to do?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 30, 2011 at 2:11 am
Please provide table def and sample data in a ready to use format as described in the first link in my signature together with your expected result.
I'm confident there's a set based solution available. Also,please confirm you're using SQL2000 or SQL7 as indicated by the forum you posted in.
May 30, 2011 at 2:36 am
BPD & BPD001,BPD002,BPD003 has a relation.
BPD001 has relation with its child(BPDX01) Item but BPD has no direct relation to BPDX01...
Input parameter id BPD
Output are BPDX01, etc as shown in picture.
May 30, 2011 at 2:41 am
Not clear.
Please post table definitions, sample data and expected results as per http://www.sqlservercentral.com/articles/Best+Practices/61537/
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 30, 2011 at 3:01 am
Maybe you could show us the code that you have achieved so far yourself ? That would help us in the best way to advise you.
May 30, 2011 at 3:30 am
Suppose in a certain Table I have all the required data. Item Code is a field of this table.
Item--- BPD (finished Good)has three child Items BPD01, BPD02, BPD03 and
BPD01 has tree child Item -- BPDX01, Qty-3
BPDX02, Qty-5
BPDX03, Qty-2
BPD02 has tree child Item -- BPDX04, Qty-1
BPDX02, Qty-4
BPDX01, Qty-2
BPD02 has tree child Item -- BPDX03, Qty-6
BPDX04, Qty-5
BPDX01, Qty-6
Some one give the input --BPD and Output will be
Item Code Qty
BPDX01 11
BPDX02 9
BPDX03 8
BPDX04 6
BPD & BPD001,BPD002,BPD003 has a relation.
BPD001 has relation with its child(BPDX01) Item but BPD has no direct relation to BPDX01...
May 30, 2011 at 3:45 am
kindly reply
May 30, 2011 at 3:47 am
Please post table definitions, sample data and expected results as per http://www.sqlservercentral.com/articles/Best+Practices/61537/
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 30, 2011 at 5:48 am
GilaMonster (5/30/2011)
Please post table definitions, sample data and expected results as per http://www.sqlservercentral.com/articles/Best+Practices/61537/
This appears to be easily solved with:
SELECT [Item Code], Qty = COUNT(*)
FROM [a Certain Table]
GROUP BY [Item Code]
ORDER BY [Item Code]
If this isn't quite what you're looking for, then remember that the people that help out here are all un-paid volunteers, so please HELP US HELP YOU. Providing the DDL scripts (CREATE TABLE, CREATE INDEX, etc.) for the tables affected, and INSERT statements to put some test data into those tables that shows your problem will go a long way in getting people to look at your issue and help you out. Please include code for what you have already tried. Don't forget to include what your expected results should be, based on the sample data provided. As a bonus to you, you will get tested code back. For more details on how to get all of this into your post, please look at the first link in my signature - Which just happens to be the same link that Gail has pointed you to twice now.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
May 30, 2011 at 7:44 am
subrata.bauri-1051938 (5/30/2011)
kindly reply
Please note that we are all volunteers and we're not spending each and every minute waiting to reply on a post. Asking for an answer just 15 minutes after your latest post seems demanding... You might have increased the chances for an answer if you would actually have followed the advice given by Gail and myself (asking for some ready to use sample data).
Unfortunately, we still don't have anything to work with.
Viewing 15 posts - 1 through 15 (of 30 total)
You must be logged in to reply to this topic. Login to reply