Click here to Skip to main content
15,913,055 members
Home / Discussions / Database
   

Database

 
AnswerRe: display exactly 2 digits after decimal point in money Pin
_Damian S_13-Jul-09 19:27
professional_Damian S_13-Jul-09 19:27 
AnswerRe: display exactly 2 digits after decimal point in money Pin
goodideadave14-Jul-09 7:24
goodideadave14-Jul-09 7:24 
AnswerRe: display exactly 2 digits after decimal point in money Pin
Niladri_Biswas15-Jul-09 16:00
Niladri_Biswas15-Jul-09 16:00 
Questionsqlpubwiz Command Line Issue. Pin
_Maxxx_13-Jul-09 17:33
professional_Maxxx_13-Jul-09 17:33 
AnswerRe: sqlpubwiz Command Line Issue. Pin
Josh Handley13-Jul-11 0:20
Josh Handley13-Jul-11 0:20 
QuestionHelp with Built-in Database: Visual Web Developer 2008 Express Pin
pstyles113-Jul-09 5:05
pstyles113-Jul-09 5:05 
AnswerRe: Help with Built-in Database: Visual Web Developer 2008 Express Pin
_Damian S_13-Jul-09 19:32
professional_Damian S_13-Jul-09 19:32 
QuestionHelp required for CTE Pin
Zafar Sultan13-Jul-09 3:33
Zafar Sultan13-Jul-09 3:33 
This is my stored procedure

ALTER PROCEDURE TeamStructure
(
@rootid int
)
AS
WITH MyTeam
AS
(
SELECT *, [Name] AS ParentName, 0 AS TeamLevel FROM tbl_team
WHERE ParentID =@rootid UNION ALL
SELECT Fam.*,MyTeam.Name AS ParentName, TeamLevel + 1 FROM tbl_team AS Fam
INNER JOIN MyTeam ON Fam.ParentID = MyTeam.ID)
SELECT * FROM MyTeam

It will return the complete hierarchical records.
Level 0 will have root member
Level 1 will have 2 members
Level 2 willhave 4 members
Level 3 will have 8 members
or if level =n
members= 2^n
I need to perform the following operation:
for any level if members are less than 2^n the iteration should stop and return the number of members on that level and the number of level
For example if the number of members on level 4 are 12
The procedure should stop and return
level :4
Members :12
but if the number of members on nth level is exactly 2^n the iteration must look for the next level
Can anyone modify this procedure and help me please?
TIA
QuestionGetting data related to what has been selected randomly from a database Pin
LucBite13-Jul-09 3:32
LucBite13-Jul-09 3:32 
AnswerRe: Getting data related to what has been selected randomly from a database Pin
Vimalsoft(Pty) Ltd13-Jul-09 3:59
professionalVimalsoft(Pty) Ltd13-Jul-09 3:59 
GeneralRe: Getting data related to what has been selected randomly from a database Pin
LucBite13-Jul-09 4:16
LucBite13-Jul-09 4:16 
GeneralRe: Getting data related to what has been selected randomly from a database Pin
Vimalsoft(Pty) Ltd13-Jul-09 4:32
professionalVimalsoft(Pty) Ltd13-Jul-09 4:32 
GeneralRe: Getting data related to what has been selected randomly from a database Pin
Blue_Boy13-Jul-09 4:33
Blue_Boy13-Jul-09 4:33 
GeneralRe: Getting data related to what has been selected randomly from a database Pin
DoctorMick13-Jul-09 6:13
DoctorMick13-Jul-09 6:13 
GeneralRe: Getting data related to what has been selected randomly from a database Pin
Jerry Hammond13-Jul-09 10:34
Jerry Hammond13-Jul-09 10:34 
QuestionSplitter container Pin
Isaac Gordon13-Jul-09 0:01
Isaac Gordon13-Jul-09 0:01 
AnswerRe: Splitter container Pin
Muhammad Mazhar13-Jul-09 0:43
Muhammad Mazhar13-Jul-09 0:43 
QuestionCan't save new records to the dataset - I'm practising with the binary formatter Pin
BluesEnd12-Jul-09 17:43
BluesEnd12-Jul-09 17:43 
QuestionReporting Services Pin
devvvy12-Jul-09 16:57
devvvy12-Jul-09 16:57 
Questionsql execution audit - tools? Pin
devvvy12-Jul-09 15:02
devvvy12-Jul-09 15:02 
AnswerRe: sql execution audit - tools? Pin
Niladri_Biswas13-Jul-09 16:17
Niladri_Biswas13-Jul-09 16:17 
QuestionSQL 2008 SQLPUBWIZ Command Line Failure Pin
Member 400112012-Jul-09 12:46
Member 400112012-Jul-09 12:46 
QuestionFROM SQL SERVER 2005 DOWNLOAD FILES FROM PSFTP Pin
ps_prakash0212-Jul-09 6:15
ps_prakash0212-Jul-09 6:15 
AnswerRe: FROM SQL SERVER 2005 DOWNLOAD FILES FROM PSFTP Pin
Jan Wild21-Dec-09 4:30
Jan Wild21-Dec-09 4:30 
QuestionHow do i retrieve data from an MS sql database hosted on a web server Pin
ChiSmile11-Jul-09 4:16
ChiSmile11-Jul-09 4: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.