|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
SQL 2005: Why does DECLARE varchar(MAX) in Stored Procedure not work?Hallo,
I have a Stored Procedure with DECLARE myString varchar(MAX) Now when I set a text which is bigger than 8000 Bytes, it gets cut. Why? I thougt SQL 2005 has now varchar(max)? Thanks for any help! Regards Andreas Klemt > Now when I set a text which is bigger than 8000 Bytes, it gets cut. Where does it get cut? Are you using PRINT, SELECT, passing the parameter to another stored procedure, inserting into a table, ...??? How did you verify whether a truncation occurred? What is the compatibility
level? ML --- http://milambda.blogspot.com/ Works for me
can you run this example create procedure TestVarcharMax @TestValue varchar(max) as select len(@TestValue) GO declare @v varchar(max) select @v = (replicate (cast('a' as varchar(max)), 9000)) exec TesTVarcharMax @v I get back 9000 Denis the SQL Menace http://sqlservercode.blogspot.com/ (1 row(s) affected) Andreas Klemt wrote: Show quoteHide quote > Hallo, > > I have a Stored Procedure with > > DECLARE myString varchar(MAX) > > Now when I set a text which is bigger than 8000 Bytes, it gets cut. > Why? I thougt SQL 2005 has now varchar(max)? > > Thanks for any help! > > Regards > Andreas Klemt
How to concatenate strings from a column into a single row (with NULL value)?
Single to Multiple columns Assistance with SQL Script HOW TO: PIVOT for unknown number of column headings? Best way to document databases ? SQL Query Programmatic package execution - SQL Server 2005 where datetime between 2PM and 3PM Database Performance query Query Help |
|||||||||||||||||||||||