I have a query which is shown below:
Decalre @sql as nvarchar(max)
set @sql = 'Insert into XYZ( [x],
THe query was wriiten by one of my developers and each column started on anew line.
The problem here is when i tried to use the following statement
EXEC sp_executeSQL @sql1
the execution is failing because the whole @sql is not fitting into nvarchar. As far i know if i use so_executesql the max length allowed is 4000, but my query is longer than tht, hence there is error becuase everything could not fit into into Nvarchar
IS there a way that i can trim the empty spaces while executing.
I have a tedious process where i bring all the columns into one single one. Is there an easy process for this?
View Complete Post