Access the answers to your technology questions today.
Subscribe Now
30-day free trial. Register in 60 seconds.
What Makes Experts Exchange Unique?
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.
Try it out and discover for yourself.
Subscribe Now
30-day free trial. Register in 60 seconds.
Join the Community
Give a Little. Get a Lot.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Join the Community
by: aneeshattingalPosted on 2009-09-08 at 16:05:45ID: 25286923
try this way
nsactionsP aid]
r,Transact ionName,Tr ansactionD ate ntSubNumbe r,Document ID,Documen tType ,Debit,Credit ) Number,@de scription, @Transacti onDate SubID,@Doc umentID,'J NL',@check value,0 )
id @id , @TransactionNumber , @description , @accountsubID ,
ALTER PROCEDURE [dbo].[usp_ATFT_FIN_setTra
-- Add the parameters for the stored procedure here
@companyID int
,@accountparentID int
,@accountsubID int
,@checkvalue decimal(18,2)
,@strInvoiceIDs varchar(100)
,@description varchar(250)
,@documentID int
,@TransactionNumber int
,@TransactionDate datetime
AS
BEGIN
SET NOCOUNT ON ;
DECLARE @err int, @i int
SET @err = @@ERROR
-- insert individual A/R transactions per invoice
-- set invoices to isPaid = 1
-- comma separated string with invoiceID's
DECLARE @values TABLE ( i int identity, id int )
DECLARE @id int
INSERT INTO @values ( id )
SELECT VALUE
FROM ufn_ParmsToList ( @strInvoiceIDs )
SELECT @i = @@ROWCOUNT
BEGIN TRANSACTION
BEGIN
-- insert bank account debit transaction
INSERT INTO dbo.tbl_FIN_Transaction ( companyID ,ClientID,TransactionNumbe
,AccountParentNumber,Accou
VALUES (@companyID,0,@Transaction
,@AccountParentID,@Account
WHILE @i > 0
BEGIN
SELECT @id = id
FROM @values
WHERE i = @i
EXEC usp_ATFT_FIN_setInvoicesPa
@checkvalue , @companyID
IF @err <> 0
BEGIN
ROLLBACK TRANSACTION
SELECT @err AS intError
RETURN
END
SET @i = @i - 1
END
COMMIT TRANSACTION
END
END
alternatively you can change the inner sp to accept the csv