日期:2014-05-18  浏览次数:20489 次

創建一個內存臨時表。下列做法有錯誤但不知怎麼糾正
declare   @tempid   table   (   MfgOrderItemIssuedId   char(16))
insert   into   @tempid(MfgOrderItemIssuedId)
select   MfgOrderItemIssuedId     from   MfgOrderItemIssued   where   MfgOrderItemIssuedId=@temp


delete   from   MfgOrderItemIssued   where   MfgOrderItemIssuedId   in   (select   MfgOrderItemIssuedId   from   @temp)
結果報
cannot   resolve   collation   conflict   for   equal   to   operation
把delete一句注釋掉就沒得這個問題
thanks

------解决方案--------------------
--try
declare @sql varchar(8000)
selet @sql= 'delete from MfgOrderItemIssued where MfgOrderItemIssuedId in (select MfgOrderItemIssuedId from '+ @tempid+ ') '
exec(@sql)