如何在SQL Server中返回包含变量的OpenQuery?
DECLARE curMyCursor CURSOR FOR
EXEC('SELECT *
FROM OPENQUERY(SYBASE,
''SELECT * FROM MyTable WHERE MyPrimaryKey=''''' + @Variable + ''''''')')
OPEN @ResultCrsr
答案 0 :(得分:2)
但为什么你需要一个光标?我相信没有它就有更好的办法。
答案 1 :(得分:2)
您必须使用TSQL,因为您无法将变量传递给<div id="p">
<div>When mousedown,a draggable green box will cover me.</div>
<div>I hope the green box will keep dragging if you dont loose your mouse and keep going</div>
<div>It works fine in chrome and safari,but not firefox</div>
</div>
:
OPENQUERY