aspnet_RegisterSchemaVersion
ALTER PROCEDURE [dbo].aspnet_RegisterSchemaVersion --不知道是不是注册版本的意思
@Feature NVARCHAR(128),
@CompatibleSchemaVersion NVARCHAR(128),
@IsCurrentVersion BIT,
@RemoveIncompatibleSchema BIT --移除不兼容的版本
AS
BEGIN
IF( @RemoveIncompatibleSchema = 1 ) --如果为真
BEGIN
DELETE FROM dbo.aspnet_SchemaVersions WHERE Feature = LOWER( @Feature )
---删除此记录
END
ELSE
BEGIN
IF( @IsCurrentVersion = 1 ) --如果是当前版本
BEGIN
UPDATE dbo.aspnet_SchemaVersions
SET IsCurrentVersion = 0
WHERE Feature = LOWER( @Feature )
-----更新当前版本为0
END
END
![](/Images/OutliningIndicators/None.gif)
INSERT dbo.aspnet_SchemaVersions( Feature, CompatibleSchemaVersion, IsCurrentVersion )
VALUES( LOWER( @Feature ), @CompatibleSchemaVersion, @IsCurrentVersion )
/*如果是兼容的版本且不是当前的版本则开始插入数据*/
END
aspnet_Setup_RestorePermissions
ALTER PROCEDURE [dbo].aspnet_Setup_RestorePermissions
@name sysname
AS
BEGIN
DECLARE @object sysname
DECLARE @protectType char(10)
DECLARE @action varchar(20)
DECLARE @grantee sysname
DECLARE @cmd nvarchar(500)
DECLARE c1 CURSOR FORWARD_ONLY FOR
SELECT Object, ProtectType, [Action], Grantee FROM #aspnet_Permissions where Object = @name
/*DECLARE @local_variable在批处理或过程的正文中用 DECLARE 语句声明变量,
并用 SET 或 SELECT 语句给其指派值。游标变量可通过该语句声明,
并且可用在其它与游标相关的语句中。所有变量在声明后均初始化为 NULL。*/
OPEN c1
/*OPEN 打开 Transact-SQL 服务器游标,然后通过执行在 DECLARE CURSOR 或
SET cursor_variable 语句中指定的 Transact-SQL 语句填充游标。*/
![](/Images/OutliningIndicators/None.gif)
FETCH c1 INTO @object, @protectType, @action, @grantee
/*FETCH 从 Transact-SQL 服务器游标中检索特定的一行。*/
/*INTO @variable_name[,
n]允许将提取操作的列数据放到局部变量中。
列表中的各个变量从左到右与游标结果集中的相应列相关联。各变量的数据
类型必须与相应的结果列的数据类型匹配或是结果列数据类型所支持的隐性转换。
变量的数目必须与游标选择列表中的列的数目一致。*/
WHILE (@@fetch_status = 0)
BEGIN
SET @cmd = @protectType + ' ' + @action + ' on ' + @object + ' TO [' + @grantee + ']'
EXEC (@cmd)
FETCH c1 INTO @object, @protectType, @action, @grantee
END
![](/Images/OutliningIndicators/None.gif)
close c1
deallocate c1
END
aspnet_UnRegisterSchemaVersion
ALTER PROCEDURE [dbo].aspnet_UnRegisterSchemaVersion
@Feature NVARCHAR(128),
@CompatibleSchemaVersion NVARCHAR(128)
AS
BEGIN
DELETE FROM dbo.aspnet_SchemaVersions
WHERE Feature = LOWER(@Feature) AND @CompatibleSchemaVersion = CompatibleSchemaVersion
/*删除符合条件的记录,好象着条才是简单的语句*/
END
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/ExpandedBlockEnd.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](/Images/OutliningIndicators/ExpandedBlockEnd.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](/Images/dot.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/ExpandedBlockEnd.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
aspnet_UnRegisterSchemaVersion
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](/Images/OutliningIndicators/None.gif)