Is it true that SQL Server 2000, you can not insert into a table variable using exec?
I tried this script and got an error message EXECUTE cannot be used as a
EXECUTE cannot be used as a
DECLARE @q nvarchar(4000) SET @q = 'DECLARE @tmp TABLE (code VARCHAR(50), mount MONEY) INSERT INTO @tmp ( code, mount ) SELECT coa_code, amount FROM T_Ledger_detail SELECT * FROM @tmp' EXEC sp_executesql @q
If you want in dynamic query