Log in Register FAQ Memberlist Search ContactReview Forum Index
A GoldMine Discussion and Support Community

ContactReview Forum Index » GoldMine 8 - 2019 (Premium Edition) » Maximum fieldcount / Maximum row lengh in SQL
Post new topic  Reply to topic View previous topic :: View next topic 
Maximum fieldcount / Maximum row lengh in SQL
PostPosted: Thu Dec 19, 2013 12:36 am Points: 0 Reply with quote
S_F
Experienced Miner
Joined: 20 Jan 2009
Posts: 57
Location: Germany




Hey there,

using 9.2.1 gmpe sql 2008 r2.

The other night i was adding new fields, qiuet a lot to be honest.
When i wanted to start the rebuild i encountered the error "Failed to copy records from CONTACT2 to GOLDMINETEMPCOPYTABLE"

I encountered this message before and did all steps to clear out the possible misstakes with goldminecopytable. Didnt work.

So i started to delete the Fields again and thought to myself, delete half of them first and try again maybe goldmine isnt handling too many adds at a time very well. So i deleted 10 of my created fields and the rebuild seemed to work.

After the rebuild i did the nessecary steps to check if everything is working fine. When it came to replicate data i encountered the following error: "Database operation error: The row with lengh of 8822 cant be created, it is longer than destination lengh of 8060" (this is translated by me, may warry with the original english errormessage)

After i deleted all my newly created fields again, everything was working normal again.

Is it possible that the GM or the SQL Database have a limit when it comes to fieldcount or rowlengh of the database?

What are the steps i could take to overcome this problem? Are there any resolutions to some kind of this behaviour?

Thanks in advance guys Smile

As always, kind regards from germany.
View user's profile Send private message

PostPosted: Thu Dec 19, 2013 11:30 am Points: 0 Reply with quote
DougCastell
GoldMine Guru
Joined: 15 Jun 2006
Posts: 1639
Location: Los Angeles, CA




Sure, don't use the REBUILD function to add your fields to contact2. Do this instead:

Quote:
Step 1: add your fields in GoldMine, be careful to say NO to the prompts from GoldMine to rebuild the database.

Step2: Execute this SQL script in SQM Management Studio

declare @fieldname varchar(15)
declare @fieldlen integer
declare @fieldtype varchar(20)
DECLARE udef CURSOR
FOR select field_name, field_type, field_len from contudef left join syscolumns on
(contudef.field_name = syscolumns.name and id in (select id from sysobjects where name = 'CONTACT2' and type = 'U'))
where dbfname = 'CONTACT2' and syscolumns.name is null
OPEN udef
FETCH NEXT FROM udef into @fieldname, @fieldtype, @fieldlen
WHILE @@fetch_status = 0
begin
if @fieldtype='N'
begin
select @fieldtype='float'
print 'alter table contact2 add ' + @fieldname + ' ' + @fieldtype + ' null'
end
if @fieldtype='D'
begin
select @fieldtype='datetime'
print 'alter table contact2 add ' + @fieldname + ' ' + @fieldtype + ' null'
end
if @fieldtype='C'
begin
select @fieldtype='varchar'
print 'alter table contact2 add ' + @fieldname + ' ' + @fieldtype + ' ' + '(' + cast(@fieldlen as varchar (3)) + ')' + ' null'
end
FETCH NEXT FROM udef into @fieldname, @fieldtype, @fieldlen
end
DEALLOCATE udef
GO


Step 3: Take the code generated by the above script, paste it into a new query window and execute it.


Note that I assume you will backup your database prior to taking these steps! Smile

_________________
Doug Castell

GoldMine Sales and Support:
http://www.castellcomputers.com/
office: (310)601-4738
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number

Maximum fieldcount / Maximum row lengh in SQL
  ContactReview Forum Index » GoldMine 8 - 2019 (Premium Edition)
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 7 Hours  
Page 1 of 1  

  
  
 Post new topic  Reply to topic  


Brought to you by Castell Computers, Doug Castell, Admin
RSS Feed
Powered by phpBB © 2001-2004 phpBB Group
Theme created by Vjacheslav Trushkin