Hi All,
I have a table in which one of the columns is Text.
I need to concatenate a hard coded text with the value of the text column
for each and every row of the table. Is this possible.
Sevugan.CI don't understand why you need to concatenate anything, *especially* the
same value for *every row.*
Can't the consuming application do that?
If you aren't storing > 8000 characters, then you could say:
DECLARE @.constant VARCHAR(12);
SET @.constant = 'some prefix';
SELECT @.constant + CONVERT(VARCHAR(7988), textColumn) FROM table;
"Sevugan" <Sevugan@.discussions.microsoft.com> wrote in message
news:A1A3FE64-4D11-4217-97AC-A8A6A380F355@.microsoft.com...
> Hi All,
> I have a table in which one of the columns is Text.
> I need to concatenate a hard coded text with the value of the text column
> for each and every row of the table. Is this possible.
>
> --
> Sevugan.C|||Hi
Thanks for your reply.
I am storing more than 8000 chars in the text column. Then, how this could
be resolved.
Sevugan.C
"Aaron Bertrand [SQL Server MVP]" wrote:
> I don't understand why you need to concatenate anything, *especially* the
> same value for *every row.*
> Can't the consuming application do that?
> If you aren't storing > 8000 characters, then you could say:
> DECLARE @.constant VARCHAR(12);
> SET @.constant = 'some prefix';
> SELECT @.constant + CONVERT(VARCHAR(7988), textColumn) FROM table;
>
>
> "Sevugan" <Sevugan@.discussions.microsoft.com> wrote in message
> news:A1A3FE64-4D11-4217-97AC-A8A6A380F355@.microsoft.com...
>
>|||> I am storing more than 8000 chars in the text column. Then, how this could
> be resolved.
Some options:
(a) have the consuming application perform the concatenation
(b) move to SQL Server 2005, where you can use VARCHAR(MAX)
(c) store your redundant prefix with the data (you can use UPDATETEXT for
that)|||Hi
I am using the third option suggested by You. But, I am getting the
following error.
What could be the reason. How it should be resolved.
Server: Msg 7123, Level 16, State 1, Procedure sp_SendStockRebalanceMails,
Line 100
Invalid text, ntext, or image pointer value
0x0100010000000000331C2F0C00000000.
The statement has been terminated.
--
Sevugan.C
"Aaron Bertrand [SQL Server MVP]" wrote:
> Some options:
> (a) have the consuming application perform the concatenation
> (b) move to SQL Server 2005, where you can use VARCHAR(MAX)
> (c) store your redundant prefix with the data (you can use UPDATETEXT for
> that)
>
>|||> I am using the third option suggested by You. But, I am getting the
> following error.
> What could be the reason. How it should be resolved.
Who knows? You forgot to include DDL, sample data, and the code in your
procedure.
http://www.aspfaq.com/5006|||> I am using the third option suggested by You. But, I am getting the
> following error.
> What could be the reason. How it should be resolved.
Who knows? You forgot to include DDL, sample data, and the code in your
procedure.
http://www.aspfaq.com/5006
No comments:
Post a Comment