有远程链接服务器[202.104.242.70]
及表x_退货主表 退货单号='TTTS002-200809-001'
执行以下语句老是出错,请问到底要怎么改才不出错!
declare @day varchar(8)
set @day='20080109'
select * from openquery([202.104.242.70],'select * from x_退货主表 where substring(退货单号,9,8)=@day')
出错信息:
服务器: 消息 8180,级别 16,状态 1,行 8
Statement(s) could not be prepared.
服务器: 消息 137,级别 15,状态 1,行 8
Must declare the variable '@day'.
[OLE/DB provider returned message: 无法完成延迟准备。]