I have a table in SQL Server 2012 BI:
CREATE TABLE CodeParts (
ID int identity(1,1) not null
,Line nvarchar(max) not null
)
loaded with parts of the very long T-SQL query stored in [Line]
column. Example:
ID | Line
----------------------
1 | BEGIN TRAN MERGE someTableWithLotOfColumns dst USING (SELECT...
2 | WHEN MATCHED THEN CASE WHEN dst.someColumn != src.someColumn...
3 | WHEN NOT MATCHED...
4 | OUTPUT...
5 | ;MERGE... next table with lot of columns blah blah blah
...| ...
25 | ;MERGE... yet another table with lot of columns
60 | COMMIT
The code have 60 lines, each of the line may be up to 12,000 characters because of number of the columns and their names' length.
I need to execute entire code built by all those rows and I don't know how to do that avoiding truncation.