删除注册表项有无法删除项,怎么办?

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[YearPlan]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[YearPlan]
CREATE TABLE [dbo].[YearPlan] (
[Id] [int] NOT NULL ,
[Org_Id] [int] NOT NULL ,
[Category_Id] [int] NOT NULL ,
[Years] [int] NULL ,
[Moth] [int] NULL ,
[Plans] [decimal](18, 0) NULL ,
[Complete] [decimal](18, 0) NULL ,
[CompleteRatio] [nvarchar] (8) COLLATE Chinese_PRC_CI_AS NULL ,
[SubmitTime] [datetime] NULL ,
[Status] [char] (4) COLLATE Chinese_PRC_CI_AS NULL ,
[Operator_Id] [nvarchar] (16) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY]
------解决方案--------------------哎呀这年头 数据库都 这么复杂了真愁死我了
郁闷看来我都不是一般的菜鸟了
学学~~~~~~~~~我 死进
学~~~~~~~~~~~~
------解决方案--------------------就按照普通的方式取就可以了。显示样式什么的在代码里处理就可以了
------解决方案--------------------sql 2000还是2005?
------解决方案--------------------帮顶
------解决方案--------------------C# code
--建立测试环境
set nocount on
create table test(ID varchar(20),年 int,月 int,计划
int,完成 int,完成率 float)
insert into test select '1','2008','3','100','80','80'
insert into test select '2','2008','1','100','3','3'
年,'计划',
sum(case when 月=1 then 计划 else 0 end )[1月],
sum(case when 月=2 then 计划 else 0 end )[2月],
sum(case when 月=3 then 计划 else 0 end )[3月],
sum(case when 月=12 then 计划 else 0 end )[12月]
group by 年
年,'完成',
sum(case when 月=1 then 完成 else 0 end )[1月],
sum(case when 月=2 then 完成 else 0 end )[2月],
sum(case when 月=3 then 完成 else 0 end )[3月],
sum(case when 月=12 then 完成 else 0 end )[12月]
group by 年
年,'完成率',
sum(case when 月=1 then 完成率 else 0 end )[1月],
sum(case when 月=2 then 完成率 else 0 end )[2月],
sum(case when 月=3 then 完成率 else 0 end )[3月],
sum(case when 月=12 then 完成率 else 0 end )[12月]
group by 年
--删除测试环境
drop table test
set nocount off
------解决方案--------------------if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[YearPlan]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)drop table [dbo].[YearPlan]GOCREATE TABLE YearPlan (
[Id] [int] NOT NULL identity(1,1),
[Years] [int] NULL ,
[Moth] [int] NULL ,
[Plans] [decimal](18, 0) NULL ,
[Complete] [decimal](18, 0) NULL ,
[CompleteRatio] [nvarchar] (8) COLLATE Chinese_PRC_CI_AS NULL) ON [PRIMARY]GOinsert into YearPlanselect ,80,'80' union allselect ,80,'40' union allselect ,80,'40' union allselect ,80,'100' union allselect ,80,'40' union allselect ,80,'10' union allselect ,80,'20' union allselect ,80,'20' union allselect ,80,'20' union allselect ,80,'20' union allselect ,80,'40' union allselect ,80,'40' union allselect ,80,'40' union allselect ,80,'40' union allselect ,80,'40' union allselect ,80,'80' union all
select ,80,'40' union allselect ,80,'20' union allselect ,80,'10'--select * from YearPlan--declare @t table([Moth] int,--
[Plans] [decimal](18, 0) ,--
[Complete] [decimal](18, 0),--
[CompleteRatio] [nvarchar](8))select [Moth],[Plans],[Complete],[CompleteRatio] into #1 from YearPlan where [Years]=2007declare @sql varchar(8000)set @sql='select 'select @sql=@sql+'sum(case when [Moth]='+cast(a.[Moth] as varchar(1000))+' then [Plans] else 0 end) as ['+cast(a.[Moth] as varchar(100)) +'月],'from(select distinct [Moth] from #1) a
set @sql=substring(@sql,1,len(@sql)-1)+' from #1 'create table #11([1月] [decimal](18, 0),[2月] [decimal](18, 0),[3月] [decimal](18, 0),[4月] [decimal](18, 0),[5月] [decimal](18, 0),[6月] [decimal](18, 0),[7月] [decimal](18, 0),[8月] [decimal](18, 0),[9月] [decimal](18, 0),[10月] [decimal](18, 0),[11月] [decimal](18, 0),[12月] [decimal](18, 0))insert into #11exec(@sql)declare @sq2 varchar(8000)set @sq2='select 'select @sq2=@sq2+'sum(case when [Moth]='+cast(a.[Moth] as varchar(1000))+' then [Complete] else 0 end) as ['+cast(a.[Moth] as varchar(100)) +'月],'from(select distinct [Moth] from #1) a
set @sq2=substring(@sq2,1,len(@sq2)-1)+' from #1 'print @sq2create table #12([1月] [decimal](18, 0),[2月] [decimal](18, 0),[3月] [decimal](18, 0),[4月] [decimal](18, 0),[5月] [decimal](18, 0),[6月] [decimal](18, 0),[7月] [decimal](18, 0),[8月] [decimal](18, 0),[9月] [decimal](18, 0),[10月] [decimal](18, 0),[11月] [decimal](18, 0),[12月] [decimal](18, 0))insert into #12exec(@sq2)
select '计划',* from #11 a union allselect '完成',* from #12drop table #11drop table #12drop table #1这个不完善,而且完成率还没有实现比较麻烦
------解决方案--------------------8楼的代码写的不错,怎么没人顶呀!!!!
------解决方案--------------------select
sum(case Moth when 1 then plans else 0 end) '1月份',
sum(case Moth when 2 then plans else 0 end)'2月份',
sum(case Moth when 3 then plans else 0 end) '3月份',
sum(case Moth when 4 then plans else 0 end) '4月份' , sum(case Moth when 5 then plans else 0 end) '5月份' , sum(case Moth when 6 then plans else 0 end) '6月份' , sum(case Moth when 7 then plans else 0 end) '7月份' ,
sum(case Moth when 8 then plans else 0 end)
'8月份',sum(case Moth when 9 then plans else 0 end)
'9月份',sum(case Moth when 10 then plans else 0 end) '10月份' ,sum(case Moth when 11 then plans else 0 end)
'11月份',sum(case Moth when 12 then plans else 0 end) '12月份'
from YearPlan where Years='2000'可以实现
...........12月 合计计划 100
sum(case Moth when 1 then complete else 0 end) '1月份',
sum(case Moth when 2 then complete else 0 end)'2月份',
sum(case Moth when 3 then complete else 0 end) '3月份',
sum(case Moth when 4 then complete else 0 end) '4月份' , sum(case Moth when 5 then complete else 0 end) '5月份' , sum(case Moth when 6 then complete else 0 end) '6月份' , sum(case Moth when 7 then complete else 0 end) '7月份' ,
sum(case Moth when 8 then complete else 0 end)
'8月份',sum(case Moth when 9 then complete else 0 end)
'9月份',sum(case Moth when 10 then complete else 0 end) '10月份' ,sum(case Moth when 11 then complete else 0 end)
'11月份',sum(case Moth when 12 then complete else 0 end) '12月份'
from YearPlan where Years='2000'可以实现
...........12月 合计完成
..........................
------解决方案--------------------你的完成率类型修改成decimal的话就方便了,可是使用下面这个select
sum(case Moth when 1 then completeratio else 0 end) '1月份',
sum(case Moth when 2 then completeratio else 0 end)'2月份',
sum(case Moth when 3 then completeratio else 0 end) '3月份',
sum(case Moth when 4 then completeratio else 0 end) '4月份' , sum(case Moth when 5 then completeratio else 0 end) '5月份' , sum(case Moth when 6 then completeratio else 0 end) '6月份' , sum(case Moth when 7 then completeratio else 0 end) '7月份' ,
sum(case Moth when 8 then completeratio else 0 end)
'8月份',sum(case Moth when 9 then completeratio else 0 end)
'9月份',sum(case Moth when 10 then completeratio else 0 end) '10月份' ,sum(case Moth when 11 then completeratio else 0 end)
'11月份',sum(case Moth when 12 then completeratio else 0 end) '12月份'
from YearPlan where Years='2000'
------解决方案--------------------select '计划',IsNull(sum(case when moth = 1 then plans end),0),IsNull(sum(case when moth = 2 then plans end),0),IsNull(sum(case when moth = 3 then plans end),0),IsNull(sum(case when moth = 4 then plans end),0),IsNull(sum(case when moth = 5 then plans end),0),IsNull(sum(case when moth = 6 then plans end),0),IsNull(sum(case when moth = 7 then plans end),0),IsNull(sum(case when moth = 8 then plans end),0),IsNull(sum(case when moth = 9 then plans end),0),IsNull(sum(case when moth = 10 then plans end),0),IsNull(sum(case when moth = 11 then plans end),0) ,IsNull(sum(case when moth = 12 then plans end),0),IsNull(sum(plans),0) from YearPlan where Years = '2008'unionselect '完成',IsNull(sum(case when moth = 1 then Complete end),0),IsNull(sum(case when moth = 2 then Complete end),0),IsNull(sum(case when moth = 3 then Complete end),0),IsNull(sum(case when moth = 4 then Complete end),0),IsNull(sum(case when moth = 5 then Complete end),0),IsNull(sum(case when moth = 6 then Complete end),0),IsNull(sum(case when moth = 7 then Complete end),0),IsNull(sum(case when moth = 8 then Complete end),0),IsNull(sum(case when moth = 9 then Complete end),0),IsNull(sum(case when moth = 10 then Complete end),0),IsNull(sum(case when moth = 11 then Complete end),0) ,IsNull(sum(case when moth = 12 then Complete end),0),IsNull(sum(Complete),0) from YearPlan where Years = '2008'
unionselect '完成率',IsNull(max(case when moth = 1 then CompleteRatio end),0),IsNull(max(case when moth = 2 then CompleteRatio end),0),IsNull(max(case when moth = 3 then CompleteRatio end),0),IsNull(max(case when moth = 4 then CompleteRatio end),0),IsNull(max(case when moth = 5 then CompleteRatio end),0),IsNull(max(case when moth = 6 then CompleteRatio end),0),IsNull(max(case when moth = 7 then CompleteRatio end),0),IsNull(max(case when moth = 8 then CompleteRatio end),0),IsNull(max(case when moth = 9 then CompleteRatio end),0),IsNull(max(case when moth = 10 then CompleteRatio end),0),IsNull(max(case when moth = 11 then CompleteRatio end),0) ,IsNull(max(case when moth = 12 then CompleteRatio end),0),(select case when sum(plans) = 0 then 0 else sum(complete)/sum(plans)*100 end from yearplan where years = '2008')
from YearPlan where Years = '2008'
group by years
------解决方案--------------------把你的完成率改成decimal吧,那样的话就可以使用这个语句实现下面的效果,遗憾的是没有合计
...........12月
..........................
完成率......................... select
sum(case Moth when 1 then plans else 0 end) '1月份',
sum(case Moth when 2 then plans else 0 end)'2月份',
sum(case Moth when 3 then plans else 0 end) '3月份',
sum(case Moth when 4 then plans else 0 end) '4月份' , sum(case Moth when 5 then plans else 0 end) '5月份' , sum(case Moth when 6 then plans else 0 end) '6月份' , sum(case Moth when 7 then plans else 0 end) '7月份' ,
sum(case Moth when 8 then plans else 0 end)
'8月份',sum(case Moth when 9 then plans else 0 end)
'9月份',sum(case Moth when 10 then plans else 0 end) '10月份' ,sum(case Moth when 11 then plans else 0 end)
'11月份',sum(case Moth when 12 then plans else 0 end) '12月份'
from YearPlan where Years='2000'unionselect
sum(case Moth when 1 then complete else 0 end) '1月份',
sum(case Moth when 2 then complete else 0 end)'2月份',
sum(case Moth when 3 then complete else 0 end) '3月份',
sum(case Moth when 4 then complete else 0 end) '4月份' , sum(case Moth when 5 then complete else 0 end) '5月份' , sum(case Moth when 6 then complete else 0 end) '6月份' , sum(case Moth when 7 then complete else 0 end) '7月份' ,
sum(case Moth when 8 then complete else 0 end)
'8月份',sum(case Moth when 9 then complete else 0 end)
'9月份',sum(case Moth when 10 then complete else 0 end) '10月份' ,sum(case Moth when 11 then complete else 0 end)
'11月份',sum(case Moth when 12 then complete else 0 end) '12月份'
from YearPlan where Years='2000'unionselect
sum(case Moth when 1 then completeratio else 0 end) '1月份',
sum(case Moth when 2 then completeratio else 0 end)'2月份',
sum(case Moth when 3 then completeratio else 0 end) '3月份',
sum(case Moth when 4 then completeratio else 0 end) '4月份' , sum(case Moth when 5 then completeratio else 0 end) '5月份' , sum(case Moth when 6 then completeratio else 0 end) '6月份' , sum(case Moth when 7 then completeratio else 0 end) '7月份' ,
sum(case Moth when 8 then completeratio else 0 end)
'8月份',sum(case Moth when 9 then completeratio else 0 end)
'9月份',sum(case Moth when 10 then completeratio else 0 end) '10月份' ,sum(case Moth when 11 then completeratio else 0 end)
'11月份',sum(case Moth when 12 then completeratio else 0 end) '12月份'
from YearPlan where Years='2000'------解决方案--------------------最终答案,把你的完成率改成decimal类型select
sum(case Moth when 1 then plans else 0 end) '1月份',
sum(case Moth when 2 then plans else 0 end)'2月份',
sum(case Moth when 3 then plans else 0 end) '3月份',
sum(case Moth when 4 then plans else 0 end) '4月份' , sum(case Moth when 5 then plans else 0 end) '5月份' , sum(case Moth when 6 then plans else 0 end) '6月份' , sum(case Moth when 7 then plans else 0 end) '7月份' ,
sum(case Moth when 8 then plans else 0 end)
'8月份',sum(case Moth when 9 then plans else 0 end)
'9月份',sum(case Moth when 10 then plans else 0 end) '10月份' ,sum(case Moth when 11 then plans else 0 end)
'11月份',sum(case Moth when 12 then plans else 0 end) '12月份' ,sum(plans) '合计'from YearPlan where Years='2000'unionselect
sum(case Moth when 1 then complete else 0 end) '1月份',
sum(case Moth when 2 then complete else 0 end)'2月份',
sum(case Moth when 3 then complete else 0 end) '3月份',
sum(case Moth when 4 then complete else 0 end) '4月份' , sum(case Moth when 5 then complete else 0 end) '5月份' , sum(case Moth when 6 then complete else 0 end) '6月份' , sum(case Moth when 7 then complete else 0 end) '7月份' ,
sum(case Moth when 8 then complete else 0 end)
'8月份',sum(case Moth when 9 then complete else 0 end)
'9月份',sum(case Moth when 10 then complete else 0 end) '10月份' ,sum(case Moth when 11 then complete else 0 end)
'11月份',sum(case Moth when 12 then complete else 0 end) '12月份' ,sum(complete) '合计'from YearPlan where Years='2000'
如果您想提高自己的技术水平,欢迎加入本站官方1号QQ群:&&,&&2号QQ群:,在群里结识技术精英和交流技术^_^
本站联系邮箱:3217人阅读
有时候发现一些可疑的进程然后删除,但是会发现每次删除之后下次还会跑出来,这就是因为注册表项没有删除完全的原因了。
那我们通过搜索注册表,可以找到可疑进程的项,这个时候就需要把他们删除,一定要把搜索得到的结果全部删除干净才行。
有时候在删除的时候会提示说&删除出错&。这个当然有很多原因了,我说下我的问题,那就可能是权限不够了。
在要删除的注册表项上面右击--权限。如果在组或用户名称里面没有看到自己的登陆用户名,那就点击添加,在弹出的&选择用户和组&里面把自己的用户名添加
进去。输入好名称之后,点击检查名称会自动帮你把名称确定并且填写完成。然后确定返回到&XX的权限&框。在上面选中自己刚添加的那个用户,然后把下面的
&完全控制&给勾上,那就OK了~
GG GL~~~~~~~
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:93136次
积分:1445
积分:1445
排名:第15564名
原创:33篇
转载:78篇
评论:15条
(2)(8)(3)(5)(1)(5)(5)(2)(32)(42)(4)(2)怎么防止病毒反复入侵?教你如何删除注册表启动项 - 软件 - 科技讯-中国第一科技门户,报道最新科技新闻
在近日举办的201...
> 怎么防止病毒反复入侵?教你如何删除注册表启动项
怎么防止病毒反复入侵?教你如何删除注册表启动项
  经常在网络上冲浪,十有八九避免不了网络病毒的攻击,用专业杀毒程序清除了这些病毒程序并重新启动计算机系统后,我们有时会发现先前已经被清除干净的病毒又卷土重来了,这是怎么回事呢?
  原来目前不少流行的网络病毒一旦启动后,会自动在计算机系统的注册表启动项中遗留有修复选项,待系统重新启动后这些病毒就能恢复到修改前的状态了。为了&拒绝&网络病毒重启,我们可以从一些细节出发,来手工将注册表中的病毒遗留选项及时删除掉,以确保计算机系统不再遭受病毒的攻击。
  阻止通过网页形式启动
  不少计算机系统感染了网络病毒后,可能会在HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce、HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run、HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunServices等注册表分支下面的键值中,出现有类似有.html或.htm这样的内容,事实上这类启动键值主要作用就是等计算机系统启动成功后,自动访问包含网络病毒的特定网站,如果我们不把这些启动键值及时删除掉的话,很容易会导致网络病毒重新发作。
  为此,我们在使用杀毒程序清除了计算机系统中的病毒后,还需要及时打开系统注册表编辑窗口,并在该窗口中逐一查看上面的几个注册表分支选项,看看这些分支下面的启动键值中是否包含有.html或.htm这样的后缀,一旦发现的话我们必须选中该键值,然后依次单击&编辑&/&删除&命令,将选中的目标键值删除掉,最后按F5功能键刷新一下系统注册表就可以了。
  当然,也有一些病毒会在上述几个注册表分支下面的启动键值中,遗留有.vbs格式的启动键值,发现这样的启动键值时我们也要一并将它们删除掉。windows7注册表项无法删除_百度知道
提问者采纳
添加everyone用户吧,然后选了完全控制就可以删了。点“添加...”然后点“高级...”,然后“现在查找...”,接下来列表里找到everyone试一试权限对话框最下面那个“高级”,然后弹出对话框选“所有者”标签,你会发现默认为SYSTEM用户。强制换成你的用户名或者everyone试试?
提问者评价
其他类似问题
为您推荐:
您可能关注的推广
注册表项的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁

我要回帖

更多关于 win7无法删除注册表项 的文章

 

随机推荐