部署clr儲存過程

2021-05-22 09:58:20 字數 2221 閱讀 3505

alter database ws set trustworthy on

use ws

go--enable clr integration   

exec sp_configure 'clr enabled', 1

goreconfigure

goif  exists (select * from sys.objects where object_id = object_id(n'[dbo].[concatenate]') and type = n'af')

drop aggregate [dbo].[concatenate]

goif  exists (select * from sys.objects where object_id = object_id(n'[dbo].[imsend]') and type in (n'p', n'pc'))

drop procedure [dbo].[imsend]

--drop the functions if they already exist

if exists (select * from sys.objects where object_id = object_id(n'[dbo].[ufn_regexismatch]') and type in (n'fn', n'if', n'tf', n'fs', n'ft'))

drop function [dbo].[ufn_regexismatch]

goif exists (select * from sys.objects where object_id = object_id(n'[dbo].[ufn_regexreplace]') and type in (n'fn', n'if', n'tf', n'fs', n'ft'))

drop function [dbo].[ufn_regexreplace]

goif exists (select * from sys.objects where object_id = object_id(n'[dbo].[ufn_regexmatches]') and type in (n'fn', n'if', n'tf', n'fs', n'ft'))

drop function [dbo].[ufn_regexmatches]

goif exists (select * from sys.objects where object_id = object_id(n'[dbo].[ufn_regexsplit]') and type in (n'fn', n'if', n'tf', n'fs', n'ft'))

drop function [dbo].[ufn_regexsplit]

goif exists (select * from sys.objects where object_id = object_id(n'[dbo].[ufn_regexsplitpart]') and type in (n'fn', n'if', n'tf', n'fs', n'ft'))

drop function [dbo].[ufn_regexsplitpart]

go--exec webs 'iows.asmx','filemove','frompath=e:/22.txt&topath=e:/study/22.txt'

--exec webs 'iows.asmx','filecopy','frompath=e:/22.txt&topath=e:/study/22.txt&overwrite=false'

--exec webs 'iows.asmx','filedelete','filepath=e:/22.txtneedbak=true' --不能刪除

-- exec webs 'iows.asmx','foldercreate','folderpath=e:/rr'

--exec webs 'iows.asmx','foldermove','srcfolderpath=e:/rr&tarfolderpath=e:/study/rr'

--exec webs 'iows.asmx','folderdelete','srcfolderpath=e:/rr&needbak=false'

exec webs 'rtxws.asmx','rtxsendtipc','recvusers=2266*immsg=中國*title=test*delaytime=0'

--exec webs 'rtxws.asmx','rtxsendtipa','recvusers=2266&immsg=中國'

regex.replace("||||")

帶引數的CLR儲存過程

昨天有學習 簡單建立與佈署clr儲存過程 知道怎樣建立以及佈署至sql中去。下面這個範例是實現clr儲存過程附帶引數 可複製 編寫clr儲存過程,有點像是在程式中直接寫sql語句一樣,不過有細規範與細節不同而已。insus.net覺得clr儲存過程,是一適合一些較穩定與成熟的程式,當佈署之後,一般不...

帶引數的CLR儲存過程

昨天有學習 簡單建立與佈署clr儲存過程 知道怎樣建立以及佈署至sql中去。下面這個範例是實現clr儲存過程附帶引數 可複製 sqlconnection connection new sqlconnection context connection true connection.open sqlc...

帶OUTPUT引數的CLR儲存過程

開啟剛才前面我們寫好的sql database project,新增乙個方法 可複製 public static void getfruitname out sqlstring fruitname,sqlbyte fruit nbr catch connection.close view code ...