I have a varchar(max)
variable named as QUERY. I'm storing a bulk of create queries in it. Its length is almost 65000+ characters. But whenever I print it or select it, it does not returns me the whole result.
DECLARE @QUERY AS VARCHAR(MAX)
SET @QUERY='';
//repopulating @QUERY with queries until the lengths reaches more than 65000
//characters, then
SELECT LEN(REPLACE(@QUERY, 'N', ''))--to check the length
PRINT @QUERY as QUERY --to get the result in print
SELECT @QUERY as QUERY --to get the result in select
How can I get my whole result? All this work is being done in a stored procedure. And the result of the procedure should be the bunch of queries from the select statement.