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

Database

 
Questionexplain entity storingduef Pin
Member 564239427-Oct-08 21:03
Member 564239427-Oct-08 21:03 
QuestionEmbedding Pin
AnieMVC27-Oct-08 18:59
AnieMVC27-Oct-08 18:59 
QuestionMYSQL Help is needed Pin
Rameez Raja27-Oct-08 18:44
Rameez Raja27-Oct-08 18:44 
AnswerRe: MYSQL Help is needed Pin
Blue_Boy28-Oct-08 0:22
Blue_Boy28-Oct-08 0:22 
QuestionHow to Check Existing Record first then Insert otherwise update statement Pin
zjaffary27-Oct-08 16:57
zjaffary27-Oct-08 16:57 
AnswerRe: How to Check Existing Record first then Insert otherwise update statement Pin
Blue_Boy28-Oct-08 0:20
Blue_Boy28-Oct-08 0:20 
AnswerRe: How to Check Existing Record first then Insert otherwise update statement Pin
Tim Carmichael28-Oct-08 2:02
Tim Carmichael28-Oct-08 2:02 
QuestionCopying data in one table to specific fields in another table Pin
Member 365120927-Oct-08 1:22
Member 365120927-Oct-08 1:22 
Typically,am new in stored procedures and have been trying to do the following.


To copy/move data in Payments Table to CustomerAccounts.The id in payment is CashId and want to Copy just the data when i pass a specific CashID.Here are my sample stored Procedures.
the Source of Data is "PaYments"
Destinatin is "CustomerAccounts".Any assistance is greatly appreciated.


XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 1


CREATE procedure Payments_CustomerAccounts

DECLARE @CatInsert varchar(2000),@CashID int,@Pay_Date date,@Amount money,@DrCr varchar(20), @PaymentModeId int,@BranchID int,@DeptID int


SET @CatInsert = 'INSERT INTO CUSTOMERACCOUNTS (ClientID,[Date],AmountPaid,[Cr/Dr],PaymentModeID,BranchID,DeptID) SELECT ' + CONVERT(varchar,@CashID) + ', Pay_Date,AmountPaid,PaymentModeID,BranchID,DeptID From PAYMENTS Where ClientID IN(' + @CashID + ')'



insert Into CUSTOMERACCOUNTS


([ClientID],[Date],[AmountPaid],[Cr/Dr],[PaymentModeID],[BarnchID],[DeptId]) VALUES(@CashId,@Pay_Date,@Amount,@[Cr/Dr],[@PaymentModeID],[BranchID],[DeptID])


-----------------2

Create Procedure INSERT_INTO_CUSTOMERACCOUNTS

Declare @CashID int

SELECT (cashID,Pay_Date,Amount,PaymentModeID,BranchID,DeptID)
From ACCOUNTS.PAYMENTS
Where CAshID=@CashID

INSERT INTO CUSTOMERACCOUNTS([ClientID],[Date],[AmountPaid],[PaymentModeID],[BranchID],[DeptId])VALUES(@CashID,@Pay_Date,Amount,PaymentModeId,BranchID,DeptID)
AnswerRe: Copying data in one table to specific fields in another table Pin
Wendelius27-Oct-08 10:00
mentorWendelius27-Oct-08 10:00 
QuestionError:The cursor does not include the table being modified or the table is not updatable through the cursor Pin
V K 226-Oct-08 19:19
V K 226-Oct-08 19:19 
AnswerCross-post (3/3) Pin
Wendelius27-Oct-08 9:21
mentorWendelius27-Oct-08 9:21 
AnswerCP IGNORE THIS USER Pin
leckey27-Oct-08 10:00
leckey27-Oct-08 10:00 
QuestionProblem : Retrive Data with ref table Pin
Ahmed R El Bohoty26-Oct-08 1:14
Ahmed R El Bohoty26-Oct-08 1:14 
AnswerRe: Problem : Retrive Data with ref table Pin
Wendelius26-Oct-08 1:34
mentorWendelius26-Oct-08 1:34 
QuestionRe: Problem : Retrive Data with ref table Pin
Ahmed R El Bohoty26-Oct-08 1:53
Ahmed R El Bohoty26-Oct-08 1:53 
AnswerRe: Problem : Retrive Data with ref table Pin
Wendelius26-Oct-08 2:06
mentorWendelius26-Oct-08 2:06 
GeneralRe: Problem : Retrive Data with ref table Pin
Ahmed R El Bohoty26-Oct-08 4:21
Ahmed R El Bohoty26-Oct-08 4:21 
GeneralRe: Problem : Retrive Data with ref table Pin
Wendelius26-Oct-08 5:28
mentorWendelius26-Oct-08 5:28 
GeneralRe: Problem : Retrive Data with ref table Pin
Ahmed R El Bohoty26-Oct-08 8:15
Ahmed R El Bohoty26-Oct-08 8:15 
GeneralRe: Problem : Retrive Data with ref table Pin
Wendelius26-Oct-08 8:23
mentorWendelius26-Oct-08 8:23 
GeneralRe: Problem : Retrive Data with ref table Pin
Ahmed R El Bohoty26-Oct-08 8:25
Ahmed R El Bohoty26-Oct-08 8:25 
GeneralRe: Problem : Retrive Data with ref table Pin
Wendelius26-Oct-08 8:33
mentorWendelius26-Oct-08 8:33 
GeneralRe: Problem : Retrive Data with ref table Pin
Ahmed R El Bohoty26-Oct-08 8:47
Ahmed R El Bohoty26-Oct-08 8:47 
GeneralRe: Problem : Retrive Data with ref table Pin
Wendelius26-Oct-08 10:59
mentorWendelius26-Oct-08 10:59 
GeneralRe: Problem : Retrive Data with ref table Pin
Ahmed R El Bohoty26-Oct-08 13:25
Ahmed R El Bohoty26-Oct-08 13: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.