Click here to Skip to main content
15,929,721 members
Home / Discussions / Database
   

Database

 
AnswerRe: Oledbparameter names with spaces Pin
Navi1523-Aug-06 19:03
Navi1523-Aug-06 19:03 
GeneralRe: Oledbparameter names with spaces Pin
GrindEspresso23-Aug-06 21:09
GrindEspresso23-Aug-06 21:09 
QuestionWhat is the simplest statement to insert a bitmap into Image column? Pin
pedestrian79723-Aug-06 13:55
pedestrian79723-Aug-06 13:55 
AnswerRe: What is the simplest statement to insert a bitmap into Image column? Pin
Jerry Hammond23-Aug-06 17:01
Jerry Hammond23-Aug-06 17:01 
QuestionDynamic EXEC [modified] Pin
em00guy23-Aug-06 8:28
em00guy23-Aug-06 8:28 
AnswerRe: Dynamic EXEC Pin
em00guy23-Aug-06 9:47
em00guy23-Aug-06 9:47 
QuestionHierarchical Rollup Help (SQL Server 2005) Pin
T-Smooth23-Aug-06 6:48
T-Smooth23-Aug-06 6:48 
AnswerRe: Hierarchical Rollup Help (SQL Server 2005) Pin
Eric Dahlvang24-Aug-06 4:26
Eric Dahlvang24-Aug-06 4:26 
Make a function:
CREATE FUNCTION dbo.GetPopTotal(@cParent varchar(50))
RETURNS int AS  
BEGIN 
declare @nTotal int
declare @nGrandTotal int
declare @cChild varchar(50)

set @nTotal = 0

DECLARE  childcursor CURSOR FOR 
SELECT DISTINCT child,pop 
FROM travel
WHERE parent = @cParent

OPEN childcursor
FETCH NEXT FROM childcursor INTO @cChild, @nGrandTotal 
WHILE @@FETCH_STATUS = 0
BEGIN
	select @nGrandTotal = @nGrandTotal + @nTotal + dbo.GetPopTotal(@cChild)

	FETCH NEXT FROM childcursor INTO @cChild, @nTotal 
END

CLOSE childcursor
DEALLOCATE childcursor

return isnull(@nGrandTotal,0)

END

Call it like this:
select parent,child, dbo.GetPopTotal(child) + pop  as PopTotal from travel


--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters

QuestionFill my Report (Crystal Report) Pin
Schimaera22-Aug-06 23:48
Schimaera22-Aug-06 23:48 
AnswerRe: Fill my Report (Crystal Report) Pin
Schimaera24-Aug-06 2:03
Schimaera24-Aug-06 2:03 
GeneralRe: Fill my Report (Crystal Report) Pin
Schimaera24-Aug-06 22:10
Schimaera24-Aug-06 22:10 
QuestionSimple problem but irriatating me Pin
sandeep kumar pundhir22-Aug-06 21:37
sandeep kumar pundhir22-Aug-06 21:37 
AnswerRe: Simple problem but irriatating me [modified] Pin
Mike Dimmick23-Aug-06 0:08
Mike Dimmick23-Aug-06 0:08 
QuestionCSV to Tab Delimiter file Pin
Yong Yau22-Aug-06 20:52
Yong Yau22-Aug-06 20:52 
AnswerRe: CSV to Tab Delimiter file Pin
Mike Dimmick23-Aug-06 0:19
Mike Dimmick23-Aug-06 0:19 
Questionquery Pin
dayakar_dn22-Aug-06 20:36
dayakar_dn22-Aug-06 20:36 
AnswerRe: query Pin
Eric Dahlvang23-Aug-06 5:10
Eric Dahlvang23-Aug-06 5:10 
Questionhow to configure a SQL Server 2000 that syncronize the data with Microsoft SQL Server 2000 Enterprise Manager [modified] Pin
Vartika Srivastava22-Aug-06 20:17
Vartika Srivastava22-Aug-06 20:17 
QuestionBulk Insert Pin
Yong Yau22-Aug-06 17:47
Yong Yau22-Aug-06 17:47 
QuestionAccessing local database created in VS 2005 [modified] Pin
Libor Tinka22-Aug-06 7:00
Libor Tinka22-Aug-06 7:00 
AnswerRe: Accessing local database created in VS 2005 Pin
Mike Dimmick22-Aug-06 23:59
Mike Dimmick22-Aug-06 23:59 
QuestionDouble field name in select statement [modified] Pin
Paddy Boyd22-Aug-06 3:14
Paddy Boyd22-Aug-06 3:14 
AnswerRe: Double field name in select statement Pin
Colin Angus Mackay22-Aug-06 5:04
Colin Angus Mackay22-Aug-06 5:04 
GeneralRe: Double field name in select statement Pin
Paddy Boyd22-Aug-06 5:08
Paddy Boyd22-Aug-06 5:08 
AnswerRe: Double field name in select statement Pin
Colin Angus Mackay22-Aug-06 5:06
Colin Angus Mackay22-Aug-06 5:06 

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.