Sql 截取、替換 字符串 ,數據批量導入

/*-------將 數據 批量導入 到 news 表中---------*/

declare @myCounter int
declare @cateID int
set @myCounter=0
set @cateID=10
while(@cateID<12)
begin
    while(@myCounter<50)
    begin
    insert into news(categoryid ,title) values(@cateID,'促進會')
    set @myCounter=@myCounter+1
    end
select @cateID
waitfor delay '00:00:10' /*延遲十秒*/
set @cateID=@cateID+1
set @myCounter=0
select @cateID
end 


update Ebook set filepath=replace(filepath ,'magazine','EBook')
/*-------將 news 表的數據 批量導入 到 book 表中---------*/ 
insert into Book(originalpic,author,publisher,isbn)
select substring(picture,7,len(picture)-6) as ss ,'編輯部','促進會','9772027153007' from news 
where categoryid=114

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章