Scripter25
asked on
DetailsView Multiple Table Insert
I am using ASP.NET DetailsView I am wanting to insert into multiple tables with the one Insert from the Detailsview can someone please shed some light on this one for me?
http://forums.asp.net/thread/1568671.aspx
consider creating a view for the data ...
then have and instead of trigger on the view to handle you updates into the
individual base tables...
then have and instead of trigger on the view to handle you updates into the
individual base tables...
ASKER
CREATE PROCEDURE dbo.Deposit
DECLARE @CheckAvailable money, @CheckBalance money, @Checking bit, @EnteredAmount smallmoney
EXECUTE dbo.GetLastValueChecking
@CheckAvailable OUTPUT,
@CheckBalance OUTPUT
IF @Checking =1
BEGIN
INSERT INTO Checking (Balance,Available)Values( @CheckBala nce,@Check Available)
END
ELSE
PRINT 'Do Something.'
DECLARE @CheckAvailable money, @CheckBalance money, @Checking bit, @EnteredAmount smallmoney
EXECUTE dbo.GetLastValueChecking
@CheckAvailable OUTPUT,
@CheckBalance OUTPUT
IF @Checking =1
BEGIN
INSERT INTO Checking (Balance,Available)Values(
END
ELSE
PRINT 'Do Something.'
ASKER
I tried doing this but it says syntax error near execute
ASKER
sorry take that back it says Syntax Error near Declare
ASKER
Look maybe this will help if I state this info first of all... I am trying to make a financial tracking site. when I enter in deposits I need to add that amount to the current balance.
ASKER
Ok I have come up with a possible new solution instead of keeping my info in separate tables I can just add them together right away but if I do then I still need to be able to pull the value of the last Balance before adding it to my deposit to make the new balance insert.
Primary Key smallmoney smallmoney datetime
ID Balance Available date
I am using a DetailsView in Insertmode to try to accomplish this. Is this even possible?
Primary Key smallmoney smallmoney datetime
ID Balance Available date
I am using a DetailsView in Insertmode to try to accomplish this. Is this even possible?
CREATE PROCEDURE dbo.Deposit
@CheckAvailable money
, @CheckBalance money
, @Checking bit
, @EnteredAmount smallmoney
as
SET NOCOUNT ON
EXECUTE dbo.GetLastValueChecking -- need account or customerid????
@CheckAvailable OUTPUT,
@CheckBalance OUTPUT
IF @Checking =1
BEGIN
INSERT INTO Checking (Balance,Available)Values( @CheckBala nce,@Check Available)
END
ELSE
PRINT 'Do Something.'
RETURN
GO
@CheckAvailable money
, @CheckBalance money
, @Checking bit
, @EnteredAmount smallmoney
as
SET NOCOUNT ON
EXECUTE dbo.GetLastValueChecking -- need account or customerid????
@CheckAvailable OUTPUT,
@CheckBalance OUTPUT
IF @Checking =1
BEGIN
INSERT INTO Checking (Balance,Available)Values(
END
ELSE
PRINT 'Do Something.'
RETURN
GO
ASKER
error procedure or function "deposit" has to many arguments specified
any ideas on that one?
any ideas on that one?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.