Skip to content

Tag: sql

SQL – concatenate strings in variable while loop with +=

I can’t concatenate in this example bellow! When I loop I get my 2 correct results. When I concatenate @MaterialCompositionEn += ‘, ‘ it works fine When I try to concatenate @MaterialCompositionEn += same query to get the 2nd row, I have a null! Result: Now when I change to: I am expecting 2…

concatenating large number of tables in sas

let’s assume i have a large list of tables say : all these tables have the same column names and number of columns, i want to stack all these tables one under the other in one dataset i tried to create a macro to do so (because i have multiple other lists that are larger than this but up until

How to fix that procedure in sql

I created procedure which count not null rows in the column, but query throws errors: @tableName is not declared and invalid object name tempTable. I don’t know why code throws that errors, because all variables are declared. Also when I make that program in another way, that code throw Msg 1087, Level …