Click here to Skip to main content
15,888,600 members
Home / Discussions / Database
   

Database

 
QuestionComplicated Summation Query Help Pin
JohnQuar12-Jul-09 7:44
JohnQuar12-Jul-09 7:44 
AnswerRe: Complicated Summation Query Help Pin
David Mujica2-Jul-09 8:37
David Mujica2-Jul-09 8:37 
GeneralRe: Complicated Summation Query Help Pin
JohnQuar12-Jul-09 8:44
JohnQuar12-Jul-09 8:44 
QuestionSequential updates Pin
Gymnast1-Jul-09 18:42
Gymnast1-Jul-09 18:42 
AnswerRe: Sequential updates [modified] Pin
Niladri_Biswas1-Jul-09 18:58
Niladri_Biswas1-Jul-09 18:58 
GeneralRe: Sequential updates Pin
Mycroft Holmes1-Jul-09 21:37
professionalMycroft Holmes1-Jul-09 21:37 
GeneralRe: Sequential updates Pin
Niladri_Biswas1-Jul-09 22:17
Niladri_Biswas1-Jul-09 22:17 
GeneralRe: Sequential updates Pin
Mycroft Holmes1-Jul-09 22:42
professionalMycroft Holmes1-Jul-09 22:42 
When you do an update on a table if you do not apply a filter you will update every name to the variable. This updates the current record being accessed by the cursor.

Declare csrPV Cursor For
	SELECT ColName_0 
	FROM stg.IRsCap
	WHERE ID > @HeadRow
OPEN csrPV 
FETCH NEXT FROM csrPV INTO @Value

WHILE @@FETCH_STATUS = 0
BEGIN	
	IF @Value != ''
		SET @LastValue = @Value
	
	IF @Value = ''
	BEGIN
		UPDATE STG.IRsCap SET ColName_0 = @LastValue
		WHERE CURRENT OF csrPV
	END	
	FETCH NEXT FROM csrPV INTO @Value
END
CLOSE csrPV
DEALLOCATE csrPV


Never underestimate the power of human stupidity
RAH

GeneralRe: Sequential updates Pin
Niladri_Biswas1-Jul-09 23:02
Niladri_Biswas1-Jul-09 23:02 
GeneralRe: Sequential updates Pin
Gymnast2-Jul-09 16:27
Gymnast2-Jul-09 16:27 
QuestionHelp necessary in making Query Pin
Saiyed Alam1-Jul-09 16:28
Saiyed Alam1-Jul-09 16:28 
AnswerRe: Help necessary in making Query Pin
Not Active1-Jul-09 18:02
mentorNot Active1-Jul-09 18:02 
General[Message Deleted] Pin
Niladri_Biswas1-Jul-09 18:36
Niladri_Biswas1-Jul-09 18:36 
GeneralRe: Help necessary in making Query Pin
Mycroft Holmes1-Jul-09 21:39
professionalMycroft Holmes1-Jul-09 21:39 
General[Message Deleted] Pin
Niladri_Biswas1-Jul-09 22:19
Niladri_Biswas1-Jul-09 22:19 
GeneralRe: Help necessary in making Query Pin
Mycroft Holmes1-Jul-09 22:48
professionalMycroft Holmes1-Jul-09 22:48 
AnswerRe: Help necessary in making Query Pin
Niladri_Biswas1-Jul-09 20:39
Niladri_Biswas1-Jul-09 20:39 
QuestionTrigger NOT Fireing... Pin
Elizma1-Jul-09 9:36
Elizma1-Jul-09 9:36 
AnswerRe: Trigger NOT Fireing... Pin
Blue_Boy1-Jul-09 11:22
Blue_Boy1-Jul-09 11:22 
AnswerRe: Trigger NOT Fireing... Pin
Jerry Hammond1-Jul-09 12:28
Jerry Hammond1-Jul-09 12:28 
GeneralRe: Trigger NOT Fireing... [modified] Pin
Elizma1-Jul-09 20:48
Elizma1-Jul-09 20:48 
QuestionDecimal field format problem Pin
Branislav Vidovic1-Jul-09 3:25
Branislav Vidovic1-Jul-09 3:25 
AnswerRe: Decimal field format problem Pin
Enver Maroshi1-Jul-09 6:58
Enver Maroshi1-Jul-09 6:58 
GeneralRe: Decimal field format problem Pin
Branislav Vidovic1-Jul-09 12:19
Branislav Vidovic1-Jul-09 12:19 
GeneralRe: Decimal field format problem Pin
Enver Maroshi1-Jul-09 23:18
Enver Maroshi1-Jul-09 23:18 

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.