/*-----选出上面插入所产生的ID作为mmsqueuelist的mmid号-----*/
select id from mmsRecord where mmsAttchmentPath=@mmsAttchmentPath and phone=@phone and mmsConten=@mmsConten
insert into mmsQueueList(mmsID,userID,phone,mmsSubject,mmsConten,mmsAttchmentPath,mmsAttchmentName,submittime,operator,Priority) values
(@mmsID,@userid,@phone,@mmsSubject,@mmsConten,@mmsAttchmentPath,@mmsAttchmentName,@sendtime,@operator,@Priority)
要讲第一条选出的ID,作为第二条语句的MMSID插入,应该怎么写好?
那你每插入一条,都要保存这个 set @id =@@identity,再插入。