I thought the table valued function call was already doing that, but that does point to an answer- perhaps it's only fetching the one row before evaluating the concatenation.
If he simple function call is giving you a more lazy evaluation evaluation, that might explain what's occurring.
I didn't explain the behavior adequately.
SELECT * FROM dbo.GetReferencedModelPointsByJobID(@JobID)
Returns someplace between 2-56 rows, depending on JobID
The second query does NOT error out, but is not returning a comma delimited string of all rows, but instead, in some cases, is returning only ONE row.
Since I'm using this to build a temp table, it doesn't error out until I attempt to fill columns in the temp table that do not exist.
If Slashdot had posted a story about "the Lone Gunmen" pilot episode, then they would have a scoop that anticipated the 9/11 attacks with a civilian airliner, by several months...
It may be that the database engine requires the subquery to break the possibility of a cycle in the code, and sequence the computation.
Nah. Not HERE, in the land of the Free, with Rule of Law!
We were right all the time. Unfettered by doctrine, dogma of allegiances, wary of our own cognitive bias, we saw what we saw.
That I'm running a risk with the first of > 800 Model Points, but in my database, I never exceed 80 modelpoints for a given job ID.
But I still don't understand why the subquery is necessary (in some cases).
I have a Table Valued Function that returns a simple parameterized view. I want to turn that view into a string.
Can anybody tell me why the first query works and the second one doesn't?
DECLARE @JobID INT
DECLARE @strOut VARCHAR(MAX)
That is not true. If my job is important and my systems are important, i'm on site to make sure that change is successful.
When I was with IBM, our policy was to open up a conference call and have all the requisite support staff on the call until the change window closed. You paid through the nose for that kind of support, but our downtime was minimal and some customers needed that.
When I am working in theater on critical systems in wartime, I don't sit in my fucking hooch and use automated tools. My ass is in front of the boxes in question to respond instantly. The alternative is broken tactical systems meaning bad information being used to make decisions meaning dead people.
Your slack attitude doesn't cut it in the places I work.
To this day, males 18+ must register. Those who do not cannot receive Federal financial aid, nor work as a GS or contract employee for the Fed.