SQL Server 2000 是真的,你不能使用 exec 插入表变量吗?
我试过这个脚本并收到一条错误消息EXECUTE cannot be used as a source when inserting into a table variable.
declare @tmp TABLE (code varchar(50), mount money)
DECLARE @q nvarchar(4000)
SET @q = 'SELECT coa_code, amount FROM T_Ledger_detail'
INSERT INTO @tmp (code, mount)
EXEC sp_executesql (@q)
SELECT * from @tmp
如果这是真的,我该怎么办?