dbTalk Databases Forums  

@insertString being truncated

microsoft.public.sqlserver.programming microsoft.public.sqlserver.programming


Discuss @insertString being truncated in the microsoft.public.sqlserver.programming forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Bob
 
Posts: n/a

Default @insertString being truncated - 07-06-2012 , 12:17 AM






I am starting with a

Declare @insertString varchar(8000)

Then I'm creating a cursor and looping through records while setting

@insertString = @insertString + 'the newest record from the cursor'

This works fine but for some reason the maximum SIZE for the @insertString stops at 4000

Why is this?

Again, it works fine as long as the len is 4000 or less.

The table field is clearly a varchar(8000)

Anybody got any ideas?

Bob Sweeney

Reply With Quote
  #2  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: @insertString being truncated - 07-06-2012 , 03:56 AM






Bob (Go1369 (AT) yahoo (DOT) com) writes:
Quote:
I am starting with a

Declare @insertString varchar(8000)

Then I'm creating a cursor and looping through records while setting

@insertString = @insertString + 'the newest record from the cursor'

This works fine but for some reason the maximum SIZE for the
@insertString stops at 4000

Why is this?

Again, it works fine as long as the len is 4000 or less.

The table field is clearly a varchar(8000)

Anybody got any ideas?
Without seeing your code?



--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx

Reply With Quote
  #3  
Old   
Bob
 
Posts: n/a

Default Re: @insertString being truncated - 07-06-2012 , 11:18 AM



On Friday, July 6, 2012 1:17:29 AM UTC-4, Bob wrote:
Quote:
I am starting with a

Declare @insertString varchar(8000)

Then I'm creating a cursor and looping through records while setting

@insertString = @insertString + 'the newest record from the cursor'

This works fine but for some reason the maximum SIZE for the @insertString stops at 4000

Why is this?

Again, it works fine as long as the len is 4000 or less.

The table field is clearly a varchar(8000)

Anybody got any ideas?

Bob Sweeney
Erland, if you don't know the answer to my question then kindly shut the fuck up.

Reply With Quote
  #4  
Old   
Gene Wirchenko
 
Posts: n/a

Default Re: @insertString being truncated - 07-06-2012 , 12:23 PM



On Fri, 6 Jul 2012 09:18:06 -0700 (PDT), Bob <Go1369 (AT) yahoo (DOT) com> wrote:

Quote:
On Friday, July 6, 2012 1:17:29 AM UTC-4, Bob wrote:
I am starting with a

Declare @insertString varchar(8000)

Then I'm creating a cursor and looping through records while setting

@insertString = @insertString + 'the newest record from the cursor'

This works fine but for some reason the maximum SIZE for the @insertString stops at 4000

Why is this?

Again, it works fine as long as the len is 4000 or less.

The table field is clearly a varchar(8000)

Anybody got any ideas?
Yes, see below.

Quote:
Bob Sweeney

Erland, if you don't know the answer to my question then kindly shut the fuck up.
You should improve your manners.

I was going to post some data that might help, but considering
how you treated Erland, no. Erland might well be the most helpful
person on this newsgroup. I would not want to see him leave because
of a jerk (you).

Sincerely,

Gene Wirchenko


Sincerely,

Gene Wirchenko

Reply With Quote
  #5  
Old   
Jeroen Mostert
 
Posts: n/a

Default Re: @insertString being truncated - 07-06-2012 , 01:59 PM



On 2012-07-06 18:18, Bob wrote:
Quote:
On Friday, July 6, 2012 1:17:29 AM UTC-4, Bob wrote:
I am starting with a

Declare @insertString varchar(8000)

Then I'm creating a cursor and looping through records while setting

@insertString = @insertString + 'the newest record from the cursor'

This works fine but for some reason the maximum SIZE for the @insertString stops at 4000

Why is this?

Again, it works fine as long as the len is 4000 or less.

The table field is clearly a varchar(8000)

Anybody got any ideas?

Bob Sweeney

Erland, if you don't know the answer to my question then kindly shut the fuck up.
May your problems multiply, and last for all your life.

--
J.

Reply With Quote
  #6  
Old   
Bob
 
Posts: n/a

Default Re: @insertString being truncated - 07-06-2012 , 02:13 PM



On Friday, July 6, 2012 1:17:29 AM UTC-4, Bob wrote:
Quote:
I am starting with a

Declare @insertString varchar(8000)

Then I'm creating a cursor and looping through records while setting

@insertString = @insertString + 'the newest record from the cursor'

This works fine but for some reason the maximum SIZE for the @insertString stops at 4000

Why is this?

Again, it works fine as long as the len is 4000 or less.

The table field is clearly a varchar(8000)

Anybody got any ideas?

Bob Sweeney
Gene, get lost. Join erlander.

Reply With Quote
  #7  
Old   
Gene Wirchenko
 
Posts: n/a

Default Re: @insertString being truncated - 07-06-2012 , 03:12 PM



On Fri, 6 Jul 2012 12:13:58 -0700 (PDT), Bob <Go1369 (AT) yahoo (DOT) com> wrote:

Quote:
On Friday, July 6, 2012 1:17:29 AM UTC-4, Bob wrote:
I am starting with a

Declare @insertString varchar(8000)

Then I'm creating a cursor and looping through records while setting

@insertString = @insertString + 'the newest record from the cursor'

This works fine but for some reason the maximum SIZE for the @insertString stops at 4000

Why is this?

Again, it works fine as long as the len is 4000 or less.

The table field is clearly a varchar(8000)

Anybody got any ideas?

Bob Sweeney

Gene, get lost. Join erlander.
Erland is here, and so am I.

Ah, your language is a little politer there. Keep working on it,
and you may be fit company yet.

When you finish digging that hole for yourself, what are you
going to do with it? I suggest that you might try filling it in. An
apology would be nice.

Sincerely,

Gene Wirchenko

Reply With Quote
  #8  
Old   
phil hunt
 
Posts: n/a

Default Re: @insertString being truncated - 07-06-2012 , 03:39 PM



I you are looking at the data from the studio, please know that there is
limit on the size of field being shown. Run a query to detremine the actual
length instead.


"Bob" <Go1369 (AT) yahoo (DOT) com> wrote

Quote:
I am starting with a

Declare @insertString varchar(8000)

Then I'm creating a cursor and looping through records while setting

@insertString = @insertString + 'the newest record from the cursor'

This works fine but for some reason the maximum SIZE for the @insertString
stops at 4000

Why is this?

Again, it works fine as long as the len is 4000 or less.

The table field is clearly a varchar(8000)

Anybody got any ideas?

Bob Sweeney

Reply With Quote
  #9  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: @insertString being truncated - 07-06-2012 , 04:44 PM



Bob (Go1369 (AT) yahoo (DOT) com) writes:
Quote:
On Friday, July 6, 2012 1:17:29 AM UTC-4, Bob wrote:
I am starting with a

Declare @insertString varchar(8000)

Then I'm creating a cursor and looping through records while setting

@insertString = @insertString + 'the newest record from the cursor'

This works fine but for some reason the maximum SIZE for the
@insertString stops at 4000

Why is this?

Again, it works fine as long as the len is 4000 or less.

The table field is clearly a varchar(8000)

Anybody got any ideas?

Erland, if you don't know the answer to my question then kindly shut the
fuck up.
That's correct. I don't know the answer to your question. But if you had
given me sufficient information, for instance the code you are having
problem, I might have been able to help.

Sure, I could produce a number of guesses, but having answered a couple
of questions on newsgroups and forums, my experience is that the root of
the problem lies in something the poster did not tell me.

--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.