111,126
社区成员
发帖
与我相关
我的任务
分享
create proc mypro
as
declare @brandname1 uniqueidentifier
declare @brandname2 nvarchar(50)
declare @brandname3 varchar(100)
declare @brandname4 nvarchar(4000)
declare cur cursor for
select country.countryid,made.madename,made.madelogo,made.madehistory from made
inner join country on made.madecountry = country.countryname order by made.madefirstletter
open cur
fetch next from cur
into @brandname1,@brandname2,@brandname3,@brandname4
WHILE @@FETCH_STATUS=0
begin
insert into brand(CountryID,BrandName,Logo,BriefIntroduction) values(@brandname1,@brandname2,@brandname3,@brandname4)
fetch next from cur into @brandname1,@brandname2,@brandname3,@brandname4
end
close cur
deallocate cur
exec mypro