declare @i int
select @i=0
while @i<=160
begin
exec sp_textcopy '192.168.0.2','sa','','史双全','aaa','英语单词','D:\毕业设计\sound\0a\0aw\1.wav','where 编号=1','I'
set @i=@i+1
end
select @i=0
while @i<=160
begin
exec sp_textcopy '192.168.0.2','sa','','史双全','aaa','英语单词','D:\毕业设计\sound\0a\0aw\1.wav','where 编号=1','I'
set @i=@i+1
end
declare @i int select @i=0
while @i<=160
begin
exec sp_textcopy '192.168.0.2','sa','','史双全','aaa','英语单词','D:\毕业设计\sound\0a\0aw\1.wav','where 编号=1','I'
set @i=@i+1
end
while @i<=160
begin
exec sp_textcopy '192.168.0.2','sa','','史双全','aaa','英语单词','D:\毕业设计\sound\0a\0aw\@i.wav','where 编号=@i','I'
set @i=@i+1
end 请问若改成 exec sp_textcopy '192.168.0.2','sa','','史双全','aaa','英语单词','D:\毕业设计\sound\0a\0aw\@i.wav','where 编号=@i','I'
又会出错,应怎么办?我就是想把'D:\毕业设计\sound\0a\0aw目录下的1.wav--160.wav存入数据库应怎么办?小弟在这里先谢了
DB-Library version 8.00.194
SQL Server 'SSQ' Message 137: 必须声明变量 '@i'。 (Concerning line 1)
DB-Library Error 10007: SQL Server 常规错误: 请检查来自 SQL Server 的消息。
ERROR: Query execution failed.
NULL
就是这个错,我单独导入行。如 sp_textcopy '192.168.0.2','sa','','史双全','aaa','英语单词','D:\毕业设计\sound\0a\0aw\5.wav','where 编号=5','I'
但该为@i就不行了,应该怎么写?1.wav--160.wav怎么导入,写成
exec sp_textcopy '192.168.0.2','sa','','史双全','aaa','英语单词','D:\毕业设计\sound\0a\0aw\@i.wav','where 编号=@i','I'
对吗?
declare @i int
select @i=0
while @i<=160
begin
declare @sql varchar(8000)
set @sql='exec sp_textcopy ''192.168.0.2'',''sa'','''',''史双全'',''aaa'',''英语单词'',''D:\毕业设计\sound\0a\0aw\1.wav'',''where 编号='+cast(@i as varchar)+''',''I'''
exec(@sql)
set @i=@i+1
end
分别存进对应的编号里。执行完会输出160个一样的提示
TEXTCOPY Version 1.0
DB-Library version 8.00.194
Data copied into SQL Server image column from file 'D:\毕业设计\sound\0a\0aw\1.wav'.
NULL
,是不是把1.wav存了160次阿,怎么依次存入阿,麻烦您了
declare @i int
select @i=0
while @i<=160
begin
declare @sql varchar(8000)
set @sql='exec sp_textcopy ''192.168.0.2'',''sa'','''',''史双全'',''aaa'',''英语单词'',''D:\毕业设计\sound\0a\0aw\'+cast(@i as varchar)+'.wav'',''where 编号='+cast(@i as varchar)+''',''I'''
exec(@sql)
set @i=@i+1
end
TEXTCOPY Version 1.0
DB-Library version 8.00.194
ERROR: Problem with file 'D:\毕业设计\sound\0a\0aw\72.wa'.
NULL到100个以后就会变成TEXTCOPY Version 1.0
DB-Library version 8.00.194
ERROR: Problem with file 'D:\毕业设计\sound\0a\0aw\153.w'.
NULL
也就是扩展名会由.wav 变成.wa再变为.w 这是怎么回事????超级辛苦了
三级钻石没见过。。