我有一个像这样的存储过程,如果它不存在,它基本上会在字段中附加一个前缀:
ALTER PROCEDURE [dbo].[AgSp_UpdateAgTbl_Licensing ](@newPrefix nvarchar, @systemName nvarchar)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
update AgTbl_Licensing
set UrlPrefixes =
case
when UrlPrefixes is null or UrlPrefixes = ''
then @newPrefix
else convert ( nvarchar( max ), UrlPrefixes) + ', '+@newPrefix
end
where SystemName = @systemName and (UrlPrefixes not like ('%'+@newPrefix+'%') or UrlPrefixes is null)
END
我试着这样称呼它:
Execute AgSp_UpdateAgTbl_Licensing 'eb_', 'EB1';
但是没有对数据库进行更新 - 怎么会?我无法调试,因为我没有系统管理员