Thanks,

I'm translating databases from Sybase to SQL Server :

I use in SQL Server database the type Text
But in the stored procedures, it's absolutely impossible to use TEXT instead of LONG VARCHAR for the codepage function's parameter , for example :

in SYBASE
alter procedure
dba.codepage(@atarget long varchar)
as
begin
declare @coding long varchar
select @coding=(select CODE from LQCODE where LMValue=shortname(@atarget,300))
--message 'test: '||coding;
if locate(@atarget,'/cgi-bin/affnet/redir&#39>0
message @coding||' atarget '||@atarget type info to console
return @coding
end

In SQL Server
alter procedure
dbo.codepage(@atarget varchar(8000), @retcoding varchar(8000))
as
begin
declare @coding varchar(8000)
declare @retshortname varchar(8000)
execute shortname @atarget,300,@retshortname output
select @coding=(select [CODE] from LQCODE where LMValue=@retshortname)
--message 'test: '||coding;
if patindex(@atarget,'/cgi-bin/affnet/redir&#39>0
print @coding + ' atarget ' + @atarget
select @retcoding = @coding
return
end
go

So I replace text by varchar(8000). So I can go but long varchar is biggest than varchar(8000) and text is biggest than lon varchar and not operational in stored procedures.

So what can I do ???