sql server - How to retrieve as a text the value of a very long varcharmax in SSMS -


i can't find exact solution problem. have sql script creates long script in different steps.

what is, along script, add new pieces of script varchar(max) using concatenation. final script long it's difficult me it. use following final instruction:

select [processing-instruction(x)] = @myscript  xml path(''), type; 

in way can manage quite long results result long seems ssms runs out of memory.

i tried saving variable @myscript selecting , saving result text or file saves less 20k characters. have set xml max output length unlimited , seems work when click on result cell blue content (the xml script) ssms freezes.

the nice thing appearently script generated quite fast (i logging print different steps) can't see results of efforts.

is there way can hold of content of lengthy varchar(max) ?

thanks

create procedure selects variable output.

select @myscript xmldata xml path(''), type; 

then go command line , execute:

bcp "exec sp_outputxml" queryout myscript.xml -w -t -s <server> -d <database> 

if wanted t-sql run bcp command xp_cmdshell if have enabled on server.


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -