9999热视频三级毛片AV区|日韩欧美精品狼友观看视频|av在线成人免费AA片|日韩三级AV电影|久久亚洲私人国产精品vA|亚洲无码卡一卡二卡三|手机在线免费看黄色片|婷婷尹人在线婷婷五月手机网|99爱在线播放|欧美成人色情视频品

使用 sql server 添加刪除修改查詢儲存過程
來源:易賢網 閱讀:1576 次 日期:2014-12-22 15:22:07
溫馨提示:易賢網小編為您整理了“使用 sql server 添加刪除修改查詢儲存過程”,方便廣大網友查閱!

--添加

create procedure usp_add

(

@table nvarchar(255),

@values nvarchar(max)=null

)

as

declare @sql nvarchar(max)

set @sql='insert into>

if @values is not null

set @sql='insert into values(

exec sp_executesql @sql

select @@identity

go

exec usp_add '金山股份' ,'''abc'',20,300'

go

--刪除

create procedure usp_delete

(

@table nvarchar(255),

@where nvarchar(max)=null

)

as

declare @sql nvarchar(max)

set @sql='delete

if @where is not null

set @sql+=' where

exec sp_executesql @sql

go

exec usp_delete '金山股分','id=1'

go

--修改

create procedure usp_update

(

@table nvarchar(255),

@set nvarchar(max),

@where nvarchar(max)=null

)

as

declare @sql nvarchar(max)

set @sql='update set

if @where is not null

set @sql+=' where

exec sp_executesql @sql

go

exec usp_update '金山股份','stockname=''騰訊股分''','id=2'

go

--查找

create procedure usp_select

(

@table nvarchar(255),

@where nvarchar(max)=null

)

as

declare @sql nvarchar(max)

set @sql='select * from

if @where is not null

set @sql=@sql+' where

exec sp_executesql @sql

go

exec usp_select 'stock','id=1'

go

更多信息請查看IT技術專欄

更多信息請查看數據庫
關于我們 | 聯(lián)系我們 | 人才招聘 | 網站聲明 | 網站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 新媒體/短視頻平臺 | 手機站點

版權所有:易賢網