Quantcast
Channel: Programmer's Town - Count of lines in dynamic request
Viewing all articles
Browse latest Browse all 8

Re: Count of lines in dynamic request

$
0
0
iap wrote:

it is passed...
At first, not Cost, and COUNT?
Secondly, did not understand sense of words about different columns - I like told to you;
That NULL and so do not get to result of your request.
And SELECT in which it is caused COUNT, it is logically fulfilled after WHERE

Yes, it is finite Count (*)
Me at last reached
Now all works, all thanks smile

SET @s = ' SET @cn = (SELECT Count (*)
FROM Result
WHERE Id_s = ' + @id_s + ' and ' + COL_NAME (OBJECT_ID (' Result '), @sch) + '> = ' + CAST (@min as varchar) +
' and ' + COL_NAME (OBJECT_ID (' Result '), @sch) + ' <' + CAST (@max as varchar) + ')'
execute sp_executesql @s, N ' @cn int output ', @cn out

Viewing all articles
Browse latest Browse all 8

Trending Articles