Re: SQL Server String Concatenation Limits
From: Larry Menzin (LarryMenzin_at_discussions.microsoft.com)
Date: 10/25/04
- Next message: Tim Baur: "Re: Null value in smalldatetime field in SQL Server"
- Previous message: Jeff Johnson [MVP: VB]: "Re: Null value in smalldatetime field in SQL Server"
- In reply to: Adam Machanic: "Re: SQL Server String Concatenation Limits"
- Next in thread: Adam Machanic: "Re: SQL Server String Concatenation Limits"
- Reply: Adam Machanic: "Re: SQL Server String Concatenation Limits"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 25 Oct 2004 10:19:02 -0700
Adam,
This is because of the 8000 character limit on varchar strings. If our
string exceeds the limit, we have no choice but to work in chunks. Is there a
different approach that would work? We dynamically build SQL strings from a
metadata repository and these strings can exceed 20,000 characters.
Larry
"Adam Machanic" wrote:
> Larry,
>
> Why are you passing the strings in as three shorter chunks instead of a
> single large chunk? You're correct, you will need to use UpdateText to
> append the strings if you do need to work with 8000-characters at a time.
>
>
> --
> Adam Machanic
> SQL Server MVP
> http://www.sqljunkies.com/weblog/amachanic
> --
>
>
> "Larry Menzin" <LarryMenzin@discussions.microsoft.com> wrote in message
> news:519A3B7F-8A47-499D-95D4-AC0AF1B38CD9@microsoft.com...
> > We are using long SQL strings (up to 24,000 characters)
> > for some of our operations. We need to insert these long
> > strings into a text field in a table for logging purposes.
> >
> > Using @string1, @string2, and @string3, all of which are
> > up to 8000 characters, we cannot succeed in using:
> >
> > INSERT
> > into TestTable
> > Select @string1+@string2+@string3
> >
> > and get more than 8000 characters in the table field (defined as text
> type).
> >
> > What are we doing wrong? What is the workaround? Would
> > using WriteText and UpdateText be useful?
> > .
> >
> >
> > --
> > Larry Menzin
> > American Techsystems Corp.
>
>
>
- Next message: Tim Baur: "Re: Null value in smalldatetime field in SQL Server"
- Previous message: Jeff Johnson [MVP: VB]: "Re: Null value in smalldatetime field in SQL Server"
- In reply to: Adam Machanic: "Re: SQL Server String Concatenation Limits"
- Next in thread: Adam Machanic: "Re: SQL Server String Concatenation Limits"
- Reply: Adam Machanic: "Re: SQL Server String Concatenation Limits"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|