創建一個內存臨時表。下列做法有錯誤但不知怎麼糾正
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)