0
說我有一個臨時表所示:信用卡/借記格式
create table #temptable
(
RecordId int,
Balance money NOT NULL,
)
我現在填充與只傳遞一個客戶從存儲過程中獲取的數據臨時表參考。
Insert into #temptable
exec getstatementhistory @cust_ref
我現在想要做一些更新/插入到一個不同的表,使用已存儲在#temptable
的信息。我有一個問題,雖然,我希望所有的借記存儲在#temptable
像這樣103.85
和所有的學分將被存儲在#temptable
這樣-103.85
我的問題,是存儲過程執行相反的約定,以便借方的格式爲這-103.85
和這樣的積分103.85
我需要的是在INSERT INTO #temptable
指定扭轉平衡約定。
即如果從SP傳遞-103.85
,將其存儲在作爲#temptable
103.85
,反之亦然。
任何人都可以提出一種改變我的插入語句來控制我的臨時表中Balance
字段的信用/借記格式的方法。
你可以粘貼你當前的'INSERT'語句嗎?基本上你必須否定插入到'balance'中的值。 –