create procedure up_adddate(@name varchar(50), @km_name varchar(50), @secore int)
as
set nocount on declare @xh_code intselect @xh_code = 序号 from table_name where 姓名= @name set @xh_code += 1insert into table_name values('张三',@xh_code, @km_name, @secore)
return
go
as
set nocount on declare @xh_code intselect @xh_code = 序号 from table_name where 姓名= @name set @xh_code += 1insert into table_name values('张三',@xh_code, @km_name, @secore)
return
go
解决方案 »
- 如何更新已经修改过存储过程?
- 一个select的问题
- 把一个表的2个字段更新到另一个表
- 【请问】要调试sqlserver里的存储过程需要什么样的权限...
- 如何将多个CREATE VIEW 语句放在一个事务中
- 问一下各位老大,为什么存储过程传不出返回值
- 救命啊。我的SQL SERVER安装不上。操作系统是2000 SERVER
- 如何将WORD文件写入数据库
- 请问如何用SQL2000企业管理器登陆远程SQL2000 服务器?
- 在mssqlserver2000中如何实现cross table
- 错误代码 8004E00F - COM+ 无法与 Microsoft 分布式事务协调程序交谈事件日志可能包含其他疑难解答信息。
- 数据库数据抓取计算问题
if object_id('tb') is not null
drop table tb
go
create table tb([姓名] varchar(10), [序号] int, [科目] varchar(10), [分数] int)
insert into tb
select '张三', 1, '语文', 85 union all
select '李四', 1, '语文', 80 union all
select '李四', 2, '数学', 90 insert into tb
select distinct [姓名],
(select max([序号])+1 from tb where [姓名]=a.[姓名]) [序号],
'体育' [科目],
90 [分数]
from tb aselect * from tb order by [姓名],[序号]
/*
姓名 序号 科目 分数
李四 1 语文 80
李四 2 数学 90
李四 3 体育 90
张三 1 语文 85
张三 2 体育 90
*/