This is my first post on the TeraData developer forum. So I apologize in advance if my question has already been asked earlier or I did not follow any convention.
I am migrating a TeraData stored procedure to SQL Server 2012. I really dont know anything about TeraData and its only for this specific project that I am using it.
I have the following piece of code that I really dont understand and I am looking for some help in translating it to a T-SQL version.
To return the results of a SELECT you need to use a cursor in Teradata (and Standard SQL), of course this is not a real cursor where you fetch one row after the other, it's just a spool like any other result set.
EXEC sp_executesql @cur_stmt1;
And then it's simply checking if the answer set is empty and returns a single row answer set with that `select 0 ...` instead.
This question has been answered by dnoeth on Stackoverflow. Anyone needing an answer, here's the link: