Click here to Skip to main content
12,699,807 members (35,389 online)
Rate this:
 
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 19:40pm
Updated 31-Dec-12 19:44pm
v2
Comments
prashant patil 4987 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 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
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.170118.1 | Last Updated 1 Jan 2013
Copyright © CodeProject, 1999-2017
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