Click here to Skip to main content
15,886,422 members
Home / Discussions / Database
   

Database

 
QuestionHow to create data copies SQL Server 2005 Express ? Pin
Member 245846716-Dec-14 17:03
Member 245846716-Dec-14 17:03 
AnswerRe: How to create data copies SQL Server 2005 Express ? Pin
Mycroft Holmes16-Dec-14 18:35
professionalMycroft Holmes16-Dec-14 18:35 
GeneralRe: How to create data copies SQL Server 2005 Express ? Pin
Member 245846716-Dec-14 22:13
Member 245846716-Dec-14 22:13 
GeneralRe: How to create data copies SQL Server 2005 Express ? Pin
Mycroft Holmes17-Dec-14 11:49
professionalMycroft Holmes17-Dec-14 11:49 
GeneralRe: How to create data copies SQL Server 2005 Express ? Pin
Member 245846717-Dec-14 20:59
Member 245846717-Dec-14 20:59 
GeneralRe: How to create data copies SQL Server 2005 Express ? Pin
Mycroft Holmes17-Dec-14 21:39
professionalMycroft Holmes17-Dec-14 21:39 
GeneralRe: How to create data copies SQL Server 2005 Express ? Pin
Member 245846721-Dec-14 17:01
Member 245846721-Dec-14 17:01 
QuestionChange cursor to common table Pin
Amr Mohammad15-Dec-14 1:16
Amr Mohammad15-Dec-14 1:16 
How can I change the below code snippet from using cursor to using table expression. The below code is about getting specific data for general account and all accounts below such given account

FUNCTION [dbo].[GetChildrenAccount] 
(@AccountID INT, 
 @DateFrom DATETIME,
 @DateTo DATETIME,
 --@TypeTransaction INT,
 --@Currnecy INT,
 @Branch INT) 

RETURNS DECIMAL(18,3)
     AS      
BEGIN 
    
DECLARE @Account_ID AS BIGINT,
        @IsLeaf AS BIT,
        @TotalValue AS DECIMAL(18,3),

SELECT @TotalValue = ISNULL(SUM(JournalDet_Debit),0) * CASE WHEN @Currnecy = 0 THEN AccountBranch_CurrencyConv ELSE 1 END
FROM AccountTree 
INNER JOIN Account_InBranch ON (AccountBranch_AccountID = Account_ID)
LEFT JOIN Journal_Details ON (Account_ID = JournalDet_AccountID) 
LEFT JOIN Journal_Head ON (Journal_ID = JournalDet_HeadID)
WHERE (Account_ParentID = @AccountID OR Account_ID = @AccountID )
AND Journal_BranchID = @Branch 
AND Journal_Date >= @DateFrom AND Journal_Date <= @DateTo
GROUP BY AccountBranch_BegBalDebit , AccountBranch_BalanceDebit , AccountBranch_CurrencyConv

OPEN GetAccount_ID      	      
	FETCH NEXT FROM GetAccount_ID INTO @Account_ID      
	WHILE @@fetch_Status = 0      
	BEGIN      
	SET @TotalValue = @TotalValue + dbo.GetChildrenAccount(@Account_ID,@DateFrom,@DateTo,@Branch)
	FETCH NEXT FROM GetAccount_ID INTO  @Account_ID     
	END      	      
	CLOSE GetAccount_ID      
DEALLOCATE GetAccount_ID  	

RETURN ISNULL(@TotalValue,0)
END

SuggestionRe: Change cursor to common table Pin
Richard Deeming15-Dec-14 2:56
mveRichard Deeming15-Dec-14 2:56 
GeneralRe: Change cursor to common table Pin
Amr Mohammad15-Dec-14 8:22
Amr Mohammad15-Dec-14 8:22 
AnswerRe: Change cursor to common table Pin
Richard Deeming15-Dec-14 10:32
mveRichard Deeming15-Dec-14 10:32 
GeneralRe: Change cursor to common table Pin
Amr Mohammad16-Dec-14 21:40
Amr Mohammad16-Dec-14 21:40 
GeneralRe: Change cursor to common table Pin
Richard Deeming17-Dec-14 2:05
mveRichard Deeming17-Dec-14 2:05 
GeneralRe: Change cursor to common table Pin
Amr Mohammad17-Dec-14 3:32
Amr Mohammad17-Dec-14 3:32 
QuestionHow can you tell if a SQL Server instance max'ed out bottleneck is Memory? Pin
devvvy11-Dec-14 4:20
devvvy11-Dec-14 4:20 
AnswerRe: How can you tell if a SQL Server instance max'ed out bottleneck is Memory? Pin
Tim Carmichael11-Dec-14 4:23
Tim Carmichael11-Dec-14 4:23 
GeneralRe: How can you tell if a SQL Server instance max'ed out bottleneck is Memory? Pin
M Riaz Bashir11-Dec-14 15:07
M Riaz Bashir11-Dec-14 15:07 
QuestionMySQL Export Problem Pin
M Riaz Bashir10-Dec-14 22:46
M Riaz Bashir10-Dec-14 22:46 
AnswerRe: MySQL Export Problem Pin
Eddy Vluggen11-Dec-14 4:59
professionalEddy Vluggen11-Dec-14 4:59 
QuestionDatabase Mail Not sending Email Pin
Robymon8-Dec-14 20:56
Robymon8-Dec-14 20:56 
QuestionDo I have to have SQL Server Express installed? Pin
jkirkerx30-Nov-14 11:31
professionaljkirkerx30-Nov-14 11:31 
AnswerRe: Do I have to have SQL Server Express installed? Pin
Richard MacCutchan30-Nov-14 21:30
mveRichard MacCutchan30-Nov-14 21:30 
GeneralRe: Do I have to have SQL Server Express installed? Pin
jkirkerx2-Dec-14 10:21
professionaljkirkerx2-Dec-14 10:21 
AnswerRe: Do I have to have SQL Server Express installed? Pin
Eddy Vluggen2-Dec-14 7:27
professionalEddy Vluggen2-Dec-14 7:27 
GeneralRe: Do I have to have SQL Server Express installed? Pin
jkirkerx2-Dec-14 10:25
professionaljkirkerx2-Dec-14 10:25 

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.