Sample Header Ad - 728x90

exec limited to 4000 characters?

1 vote
1 answer
1590 views
trying to execute this script gives only the first select as a result
declare @sp nvarchar(max)
select @sp = concat(N'select 1 ', replicate('-', 5000), char(13) + char(10), N'select 2')
exec (@sp)
but when I lower hyphens to 1000, I get also the second select How can I overcome this limit?
Asked by aldo kern (11 rep)
Jun 14, 2022, 11:50 AM
Last activity: Jun 14, 2022, 12:11 PM