All pastes #382102 Raw Edit

Stuff

public sql v1 · immutable
·published 2007-03-05 09:15 UTC
rendered paste body
/*INSERT INTO #tmpTableSELECT blabla FROM abc LEFT JOIN 123LEFT JOIN 123LEFT JOIN 123LEFT JOIN 123....*/SET @sql = 'SELECT ' + @FieldList + ' FROM #tmpTable ' + 'GROUP BY ' + @FieldListEXEC sp_Executesql @sql