I have a SP with some parameters. Originally it just did an insert, but I have added a select statement at the end to return something based on good blog here.. The final SP will be a bit more complex than this, but considering I am still struggling with the simple version....
This is the stored procedure which I call from Alteryx using the SQL Native driver.
alter PROCEDURE spCalcCW
@custSAN int,
@prodSAN int,
@tableName varchar(50),
@SAN int
AS
BEGIN
SET NOCOUNT ON;
declare @sSQL varchar(200)
set @sSQL = 'insert into tlog (desc_, batchid) values (''' + @tableName + ''', ' + cast(@SAN as varchar(10)) + ')'
print @sSQL
exec (@sSQL)
select top 1 * from tlog order by 1 desc
END
GO
I have table of parameters to process with the SP. I am able to map everything.

I have seen several threads on this topic, good tips, but still some problems. The SP and syntax to execute it is correct when testing in TSQL. It returns a small 1 row dataset. I just cannot understand the source of this error.
Thx.
Marc.