首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

創建一個內存臨時表。下列做法有錯誤但不知怎麼糾正,该怎么处理

2012-03-20 
創建一個內存臨時表。下列做法有錯誤但不知怎麼糾正declare@tempidtable(MfgOrderItemIssuedIdchar(16))ins

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

热点排行