create procedure test_ins
as
declare @empname varchar(10)
declare SOP_Cursor scroll Cursor
for
select empname from t_hr_employee
for read only open SOP_Cursor
fetch next from SOP_Cursor into @empname
while @@fetch_status=0
begin
insert into t_test(thename) values(@empname)
fetch next from SOP_Cursor into @empname
end
close SOP_Cursor
deallocate SOP_Cursor
GO
as
declare @empname varchar(10)
declare SOP_Cursor scroll Cursor
for
select empname from t_hr_employee
for read only open SOP_Cursor
fetch next from SOP_Cursor into @empname
while @@fetch_status=0
begin
insert into t_test(thename) values(@empname)
fetch next from SOP_Cursor into @empname
end
close SOP_Cursor
deallocate SOP_Cursor
GO
解决方案 »
- 请问大家有用SQL server 2005 express edition 的吗?
- sqlserver2005 express 未指定的错误 MS Visual Database Tools
- text数据类型只能放2000多个汉字吗
- 悲剧了,如下
- 关于SQL2005判断有无(bit与varchar(1),用哪个更好)
- 求一些基本的SQL SERVER语句,谢谢,今天晚上结
- ssis 中,我想数据库之间互相导数据, 下一步如何办?
- 关于插入的问题
- 如何同时update两个表
- 为何在做大容量,复杂的数据查询过程,整个数据库都被锁住了,其它岗位都停在那了
- 如何取得某1个MSSQLSERVER数据库的所以表名
- 有关sqlserver自动将页锁转换成表锁,使修改表记录出现死锁的问题
insert into t_test(thename)
select empname from t_hr_employee
as
declare @empname varchar(10)
declare SOP_Cursor scroll Cursor
for
select empname from t_hr_employee
for read only open SOP_Cursor
fetch next from SOP_Cursor into @empname
while @@fetch_status=0
begin
insert into t_test(thename) values(@empname)
fetch next from SOP_Cursor into @empname
end
close SOP_Cursor
deallocate SOP_Cursor
GO提示:
服务器: 消息 170,级别 15,状态 1,过程 test_ins,行 13
第 13 行: ' ' 附近有语法错误。
服务器: 消息 156,级别 15,状态 1,过程 test_ins,行 15
在关键字 'end' 附近有语法错误。
create procedure test_ins
as
declare @empname varchar(10)
declare SOP_Cursor scroll Cursor
for
select empname from t_hr_employee
for read only open SOP_Cursor
fetch next from SOP_Cursor into @empname
while @@fetch_status=0
begin insert into t_test(thename) values(@empname)
fetch next from SOP_Cursor into @empname
end
close SOP_Cursor
deallocate SOP_Cursor
GO
晕倒,确实是“不可见字符”问题!搞了偶老久。