跳到主要內容

發表文章

目前顯示的是有「程式語言」標籤的文章

SQL command用來抓取資料庫時間

SQL command用來抓取資料庫時間 例如:100/03/10 08:59:39 --> 1000310085939 Select Right('000'+ cast( datepart(yy,getdate()) -1911 as nVarChar),3) + Right( '00' + cast( datepart(mm,getdate()) as nVarChar) ,2) +Right( '00' + cast( datepart(dd,getdate()) as nVarChar) ,2)+Right( '00' + cast( datepart(hour,getdate()) as nVarChar) ,2) + Right( '00' + cast( datepart(minute,getdate()) as nVarChar) ,2)+ Right( '00' + cast( datepart(second,getdate()) as nVarChar) ,2)