儲存過程帶in引數

2021-04-18 00:22:59 字數 483 閱讀 5039

set ansi_nulls on

set quoted_identifier on

goalter procedure [dbo].[testlist]

@userid nvarchar(4000)

asdeclare

@search_array nvarchar(100)

begin

set @search_array ='16,17,18,19' 

select * from users where charindex(','+rtrim([user_id])+',' , ','+ @userid +',')>0

--  set @search_array= '''' + replace(@userid,',',''',''') + '''';

--  select * from users where  [user_name] in (@search_array);

end

oracle儲存過程 帶引數的儲存過程

帶引數的儲存過程 舉例 為指定的員工漲100元的工資,列印漲前和漲後的工資 如果帶參,需要指定是輸入引數還是輸出引數 create orreplace procedure raisesalary eno in number as 定義乙個變數儲存漲前的薪水,引用emp中sal的型別作為psal的型別...

儲存過程如何呼叫帶引數的儲存過程

declare value varchar max exec tmfun getsearchstr 陝西 table1 name value output select from users where address value 顯示結果為 解釋 其中,tmfun getsearchstr 為儲存...

處理帶引數的儲存過程

儲存過程 create procedure customer select country nvarchar 15 asselect customerid,companyname,contactname from customers where country country go.aspx cs ...