Peter,
My xml spreadsheet lacks two columns that exist in OutputTable. Per business rules I'm unable to add those columns to the spreadsheet. I need to add to OutputTable during the Insert process.
Is this the section of code that I should add the columns to?:
SET @InsertSql=N'';
IF @OutputTableName<>N''
BEGIN
-- Build INSERT OutputTable ... SELECT ... statement
SELECT @InsertSql=@InsertSql+ColumnName+N','
FROM #Columns
ORDER BY ExcelColNum;
SET @InsertSql=LEFT(@InsertSql,LEN(@InsertSql)-1)
SET @InsertSql=N'INSERT '+@OutputTableName+'('+@InsertSql+N')'+nchar(13)+nchar(10)+N'SELECT '+@InsertSql+N' FROM ('+nchar(13)+nchar(10);
END
In this section of code - there exists an open parenthesis but not a closed one. Is it necessary to have a closed parenthesis?
Coding question: what's the purpose of nchar(13) and nchar(10)?
Recap: 1) Is this the right location to add additional columns, 2) do we need a closing parenthesis, 3) what's the deal with nchar(13) and nchar(10)
Thanks!
JG