Click here to Skip to main content
15,892,005 members
Home / Discussions / Database
   

Database

 
AnswerRe: How to use the Case in stored procedure Pin
Abhishek Sur13-Nov-09 5:58
professionalAbhishek Sur13-Nov-09 5:58 
AnswerRe: How to use the Case in stored procedure Pin
Abhishek Sur13-Nov-09 6:00
professionalAbhishek Sur13-Nov-09 6:00 
AnswerRe: How to use the Case in stored procedure Pin
David Skelly13-Nov-09 6:34
David Skelly13-Nov-09 6:34 
GeneralRe: How to use the Case in stored procedure Pin
Mycroft Holmes14-Nov-09 1:59
professionalMycroft Holmes14-Nov-09 1:59 
GeneralRe: How to use the Case in stored procedure Pin
Andy_L_J14-Nov-09 2:38
Andy_L_J14-Nov-09 2:38 
AnswerRe: How to use the Case in stored procedure Pin
Niladri_Biswas14-Nov-09 17:56
Niladri_Biswas14-Nov-09 17:56 
QuestionCreating Records based on Quant Field Pin
ffowler12-Nov-09 7:57
ffowler12-Nov-09 7:57 
AnswerRe: Creating Records based on Quant Field Pin
Mycroft Holmes12-Nov-09 11:35
professionalMycroft Holmes12-Nov-09 11:35 
So break it up into smaller bits.

open management studio and connect to the database - this is where you should be doing your test/creating

select *
From Widgets
Where CustomerID = @CustID


That should get you the list of widgets for the customer
Now you want to count the record for each widget type

select count(*),WidgetTypeID
From Widgets
Where CustomerID = @CustID
GroupBy WidgetTypeID


Now add the insert statement around the select

Insert OtherTable(CustID,WidgetTypeID, Qty)
select CustID, WidgetTypeID, count(*)
From Widgets
Where CustomerID = @CustID
GroupBy CustID, WidgetTypeID


Here endeth the lesson

Never underestimate the power of human stupidity
RAH

GeneralRe: Creating Records based on Quant Field Pin
David Skelly12-Nov-09 22:41
David Skelly12-Nov-09 22:41 
GeneralRe: Creating Records based on Quant Field Pin
Mycroft Holmes12-Nov-09 23:05
professionalMycroft Holmes12-Nov-09 23:05 
AnswerRe: Creating Records based on Quant Field Pin
Niladri_Biswas12-Nov-09 16:16
Niladri_Biswas12-Nov-09 16:16 
AnswerRe: Creating Records based on Quant Field Pin
David Skelly12-Nov-09 22:38
David Skelly12-Nov-09 22:38 
GeneralRe: Creating Records based on Quant Field Pin
David Skelly13-Nov-09 0:15
David Skelly13-Nov-09 0:15 
GeneralRe: Creating Records based on Quant Field Pin
ffowler13-Nov-09 1:50
ffowler13-Nov-09 1:50 
GeneralRe: Creating Records based on Quant Field Pin
David Skelly13-Nov-09 2:31
David Skelly13-Nov-09 2:31 
GeneralRe: Creating Records based on Quant Field Pin
ffowler13-Nov-09 2:50
ffowler13-Nov-09 2:50 
QuestionProblem with Datepart Pin
Vimalsoft(Pty) Ltd12-Nov-09 3:10
professionalVimalsoft(Pty) Ltd12-Nov-09 3:10 
AnswerRe: Problem with Datepart Pin
J4amieC12-Nov-09 3:52
J4amieC12-Nov-09 3:52 
AnswerRe: Problem with Datepart Pin
Not Active12-Nov-09 5:36
mentorNot Active12-Nov-09 5:36 
GeneralRe: Problem with Datepart Pin
David Skelly12-Nov-09 5:42
David Skelly12-Nov-09 5:42 
GeneralRe: Problem with Datepart Pin
Not Active12-Nov-09 5:44
mentorNot Active12-Nov-09 5:44 
AnswerRe: Problem with Datepart Pin
David Skelly12-Nov-09 5:42
David Skelly12-Nov-09 5:42 
GeneralRe: Problem with Datepart Pin
Vimalsoft(Pty) Ltd12-Nov-09 22:52
professionalVimalsoft(Pty) Ltd12-Nov-09 22:52 
QuestionChanging a column to IDENTITY Pin
garfield18511-Nov-09 22:34
garfield18511-Nov-09 22:34 
AnswerRe: Changing a column to IDENTITY Pin
Niladri_Biswas12-Nov-09 1:16
Niladri_Biswas12-Nov-09 1:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.