SQL via OBDC

jerome

New member
I take the opportunity to have your attention :
Via the odbc reader I try to pass a T-SQL of this type, but the output is null:
DECLARE @tableTemp Table(id int, amount int)
INSERT INTO @ tableTemp
SELECT id, amount
FROM table_existante
WHERE id < 100
SELECT id
FROM @ tableTemp
But when I do the following there is no problem:
SELECT id, amount
FROM table_existante
WHERE id < 100
 

Support

Administrator
Staff member
The 1st thing is to make sure your DBA gave you the writing right in the DB
Then to tick the advanced parameter “allow null SQL result”
jforum3.png


Finally I’d suggest to add the “SET NOCOUNT ON “ at the start of the SQL script
SET NOCOUNT ON
DECLARE @tableTemp Table(id int, amount int)
INSERT INTO @ tableTemp
SELECT id, amount
FROM table_existante
WHERE id < 100
SELECT id
FROM @ tableTemp
 
Top