將每日輸入明細插入到考勤表與工資表

2021-05-23 23:28:31 字數 1785 閱讀 4010

create procedure hhwtdaypay @fid int 

--將每日輸入明細插入到考勤表與工資表

--插入考勤

declare @at varchar(20) set @at=convert(varchar(100), getdate(), 23)

insert into [hwt]([fid],[date1],[m1],[idno],[workhour],[zm1]

,[zm2],[createperson],[createdate])

select [fid],[date1],[m1],[idno],[workhour],[zm1]

,[zm2],[createperson],@at

from hpayenter where fid = @fid

--插入工資

insert into [hdaypay]([fid],[code],[mitem],[uprice],[qty],[summoney]

,[cmemo],[createperson],[createdate])

select [fid],[code],[mitem],[uprice],[qty],[summoney]

,[cmemo],[createperson],@at from hpayenterson

where fid= @fid

create

procedure

hhwtdaypay

@fid

int--

將每日輸入明細插入到考勤表與工資表

--插入考勤

as--

少了此as

declare

@atvarchar(20

) set

@at=

convert

(varchar

(100

), getdate

(), 23)

insert

into

[hwt](

[fid],

[date1],

[m1],

[idno],

[workhour],

[zm1],

[zm2],

[createperson],

[createdate])

select

[fid],

[date1],

[m1],

[idno],

[workhour],

[zm1],

[zm2],

[createperson],

@atfrom

hpayenter

where

fid

=@fid

--插入工資

insert

into

[hdaypay](

[fid],

[code],

[mitem],

[uprice],

[qty],

[summoney],

[cmemo],

[createperson],

[createdate])

select

[fid],

[code],

[mitem],

[uprice],

[qty],

[summoney],

[cmemo],

[createperson],

@atfrom

hpayenterson

where

fid=

@fid

使用 Trace 將日誌輸入到檔案中

工具沒有好壞,只有適不適用。由於專案中用 log4net 過重,所以使用 trace 代替了 log4net 輸入一些簡單的日誌資訊 自定義監聽檔案 using system using system.configuration using system.diagnostics using syst...

shell指令碼按照時間將資料插入到hive

寫個shell指令碼hive 按時間定期插入分割槽表,由於今天統計的是昨天的資料所以日期減一。bin bash ds date d 1 day y m d 如果某天的資料有誤需要重跑 千萬注意shell指令碼中的空格問題 if 1 then ds 1 fisql insert overwrite t...

排序 三 插入排序(將元素比較插入到前面的位置)

參考文章 時間複雜度o n2 最好情況o n 最壞情況o n2 穩定。同冒泡 工作原理 通過構建有序序列,對於未排序資料,在已排序序列中從後向前掃瞄,找到相應位置並插入。演算法描述如下 從第乙個元素開始,該元素可以認為已經被排序 取出下乙個元素 第二個元素 作為目標元素,在已經排序的元素序列中從後向...