In a stored procedure I must have a varchar
variable of max size.
declare @a varchar(max)
This works on SQL Server 2005\08\12 but it doesn't work on 2000.
I don't need that the stored procedure works on SQL Server 2000, I only need that this instruction compile without error.
I have think that a possible solution is something like:
declare @SqlText nvarchar(100) set @SqlText = 'declare @a varchar(max)'
exec sp_executesql @SqlText
But in this way if I try to use the variable @A
compiling I get an error that says that I must declare the variable @a.
Is there any possible solution?