1234567891011121314 |
- use [db]
- declare @Myid nvarchar(50)
- declare @Myname1 nvarchar(50)
- declare @Myname2 nvarchar(50)
- declare @MyCount int
- select @MyCount=count(id) from dindan where id not in(select id from client)
- while @MyCount > 0 begin
- select top 1 percent @Myid=id,@Myname1=name1,@Myname2=name2 from dindan where id not in(select id from client)
- insert into client(id,name1,name2)values(@Myid,@Myname1,@Myname2)
- select @MyCount=count(id) from dindan where id not in(select id from client)
- end
|