游標使用範例

2021-05-22 12:01:45 字數 487 閱讀 3146

declare @colname varchar(100)

declare cu_cname cursor for

select name from syscolumns where id=object_id('sh_data_1_ok')

open cu_cname

fetch next from cu_cname into @colname

while @@fetch_status=0

begin

exec ('select

'''+@colname+''' as columnname,max from (select max(len(['+ @colname+'])) as max from sh_data_1_ok) as a')

fetch next from cu_cname into @colname

endclose cu_cname

deallocate  cu_cname

游標的使用範例

declare ordern varchar 50 臨時變數,用來儲存游標值 declare ee cursor for 申明游標 為ordernum select fid from estate base roomnumbers where paynumber is null or paynumb...

chmod使用範例

chmod 750 a.out 改變 a.out的許可權為750 chmod a x a.out 對所有使用者增加 a.out的執行許可權,a all 表示所有使用者 chmod u rwx a.out 設定屬主的許可權為讀 寫和執行,u user 表示屬主使用者 chmod g rw a.out ...

cmake使用範例

cmake作為一款跨平台的專案構建工具,其使用範圍已經越來越廣,本文以實際專案為例,展示乙個使用該編譯工具的模板。希望我們都能在這些高效的工具幫助下都享受程式設計的樂趣。project src libs modules includes build bin cmakelists 根目錄下cmakel...