Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: SQL
DECLARE @FileBody1         VARCHAR(max)
            ,@FileBody2         VARCHAR(max)
            ,@FileBody3         VARCHAR(max)
            ,@StartingIndex     INT
            ,@FileLength        INT
 

    SET @StartingIndex = 1
    SELECT  @FileLength = DATALENGTH(DC.FileBody) FROM Configuration DC WHERE DC.ID = 1
    SELECT @FileBody1 = SUBSTRING(DC.FileBody,@StartingIndex,8000)FROM Configuration DC WHERE DC.ID = 1
    SET @StartingIndex = @StartingIndex + 8000
    SELECT @FileBody2 = SUBSTRING(DC.FileBody,@StartingIndex,8000) FROM Configuration DC WHERE DC.ID = 1
    SET @StartingIndex = @StartingIndex + 8000
    SELECT @FileBody3 = SUBSTRING(DC.FileBody,@StartingIndex,8000) FROM Configuration DC WHERE DC.ID = 1
 
select @FileBody1+''+@FileBody2+''+@FileBody3
Posted 31-Dec-12 18:40pm
Edited 31-Dec-12 18:44pm
v2
Comments
prashant patil 4987 at 1-Jan-13 0:56am
   
Hey Jayesh..
First of all you have to put your question in proper way..
above question is not clear to any one. explain your question in detail.
Abhinav S at 1-Jan-13 1:19am
   
What is your question?

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You can't in practice do that, or at least you shouldn't.
Think about it: If you have two strings which can be the maximum length for a string, how long a string can the result be if you concatenate them? Answer: twice the maximum length of a string...
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 mhegazy94 488
1 Sergey Alexandrovich Kryukov 375
2 Kornfeld Eliyahu Peter 285
3 Sibeesh KV 251
4 Gihan Liyanage 189
0 Sergey Alexandrovich Kryukov 6,775
1 OriginalGriff 6,696
2 CPallini 5,345
3 George Jonsson 3,599
4 Gihan Liyanage 2,751


Advertise | Privacy | Mobile
Web01 | 2.8.140922.1 | Last Updated 1 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100