cs_Content_UpdateDate
ALTER PROCEDURE [dbo].[cs_Content_UpdateDate]
(
@ContentID int
)
AS
UPDATE
cs_Content
SET
LastModified = getdate()
WHERE
ContentID = @ContentID
/**//*更新最近操作时间*/
GO
ALTER PROCEDURE [dbo].[cs_Content_UpdateDate]
(
@ContentID int
)
AS
UPDATE
cs_Content
SET
LastModified = getdate()
WHERE
ContentID = @ContentID
/**//*更新最近操作时间*/
GO
cs_DisallowedName_CreateUpdateDelete
ALTER PROCEDURE [dbo].cs_DisallowedName_CreateUpdateDelete
( /**//*不允许的名字*/
@Name nvarchar(64),
@Replacement nvarchar(64),
@DeleteName bit = 0,
@SettingsID int
)
AS
SET Transaction Isolation Level Read UNCOMMITTED
/**//*设置事务隔离级别,Read UNCOMMITTED 执行脏读或 0 级隔离锁定,这表示不发出共享锁,
也不接受排它锁。当设置该选项时,可以对数据执行未提交读或脏读;在事务结束前可以更
改数据内的数值,行也可以出现在数据集中或从数据集消失。该选项的作用与在事务内所有
语句中的所有表上设置 NOLOCK 相同。这是四个隔离级别中限制最小的级别。*/
SET NOCOUNT ON
/**//*当 SET NOCOUNT 为 ON 时,不返回计数(表示受 Transact-SQL 语句影响的行数)。
当 SET NOCOUNT 为 OFF 时,返回计数。即使当 SET NOCOUNT 为 ON 时,
也更新 @@ROWCOUNT 函数。*/
if( @DeleteName > 0 )
BEGIN --删除此记录
DELETE FROM
cs_DisallowedNames
WHERE
DisallowedName = @Name and SettingsID = @SettingsID
END
ELSE
BEGIN --更新此记录中的DisallowedName为替换字段的信息
UPDATE cs_DisallowedNames SET
DisallowedName = @Replacement
WHERE
DisallowedName = @Name and SettingsID = @SettingsID
if( @@rowcount = 0 ) --如果为更新
BEGIN --插入新的记录
INSERT INTO cs_DisallowedNames (
DisallowedName, SettingsID
) VALUES (
@Name, @SettingsID
)
END
END
GO
ALTER PROCEDURE [dbo].cs_DisallowedName_CreateUpdateDelete
( /**//*不允许的名字*/
@Name nvarchar(64),
@Replacement nvarchar(64),
@DeleteName bit = 0,
@SettingsID int
)
AS
SET Transaction Isolation Level Read UNCOMMITTED
/**//*设置事务隔离级别,Read UNCOMMITTED 执行脏读或 0 级隔离锁定,这表示不发出共享锁,
也不接受排它锁。当设置该选项时,可以对数据执行未提交读或脏读;在事务结束前可以更
改数据内的数值,行也可以出现在数据集中或从数据集消失。该选项的作用与在事务内所有
语句中的所有表上设置 NOLOCK 相同。这是四个隔离级别中限制最小的级别。*/
SET NOCOUNT ON
/**//*当 SET NOCOUNT 为 ON 时,不返回计数(表示受 Transact-SQL 语句影响的行数)。
当 SET NOCOUNT 为 OFF 时,返回计数。即使当 SET NOCOUNT 为 ON 时,
也更新 @@ROWCOUNT 函数。*/
if( @DeleteName > 0 )
BEGIN --删除此记录
DELETE FROM
cs_DisallowedNames
WHERE
DisallowedName = @Name and SettingsID = @SettingsID
END
ELSE
BEGIN --更新此记录中的DisallowedName为替换字段的信息
UPDATE cs_DisallowedNames SET
DisallowedName = @Replacement
WHERE
DisallowedName = @Name and SettingsID = @SettingsID
if( @@rowcount = 0 ) --如果为更新
BEGIN --插入新的记录
INSERT INTO cs_DisallowedNames (
DisallowedName, SettingsID
) VALUES (
@Name, @SettingsID
)
END
END
GO
cs_DisallowedNames_Get
ALTER PROCEDURE [dbo].cs_DisallowedNames_Get
(
@SettingsID int
)
AS
SET Transaction Isolation Level Read UNCOMMITTED
SELECT
DisallowedName
FROM
cs_DisallowedNames
WHERE
SettingsID = @SettingsID
/**//*获取DisallowedName,还是有很多个存储过程语句倒是很简单的*/
GO
ALTER PROCEDURE [dbo].cs_DisallowedNames_Get
(
@SettingsID int
)
AS
SET Transaction Isolation Level Read UNCOMMITTED
SELECT
DisallowedName
FROM
cs_DisallowedNames
WHERE
SettingsID = @SettingsID
/**//*获取DisallowedName,还是有很多个存储过程语句倒是很简单的*/
GO