all groups > sql server replication > august 2007 >
You're in the

sql server replication

group:

string data, right truncation, not collation issue


Re: string data, right truncation, not collation issue Hilary Cotter
8/31/2007 12:00:00 AM
sql server replication:
Can you try to bcp the data out into the file system and then bcp it into
the subscriber?

Also can you send me the schema of the problem table(s).

--
RelevantNoise.com - dedicated to mining blogs for business intelligence.

Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
[quoted text, click to view]

string data, right truncation, not collation issue Damien
8/31/2007 1:09:58 AM
I've been trying for the last few days to get replication up and
running between two servers, and I keep getting these kinds of errors.

The table in question has only three varchar columns, and on both
source and destination they're Latin1_General_CI_AS. There are no BLOB
type columns in the table.

The tables in question can definitely be replicated in general,
because this is a second subscription I'm trying to set up, I just
can't seem to apply any recent snapshots.

The Publisher/Distributor is running on Windows 2000. The Subscriber
I'm trying to set up is Windows 2003. The existing subscriber is also
on 2003. Both machines are running SQL Server 2000, SP 4.

I don't think it comes down to network issues or 2000 <-> 2003 issues
however, because my most recent attempt is with me copying the
snapshot files local to the machine and md5 comparing them to the
source.

Basically, I'm short on ideas of where to look next.

Damien
Re: string data, right truncation, not collation issue Damien
8/31/2007 7:04:53 AM
[quoted text, click to view]
Schema for the table:

CREATE TABLE [dbo].[SessionAudit] (
[SessionAuditID] uniqueidentifier ROWGUIDCOL NOT NULL ,
[CounsellorID] [uniqueidentifier] NULL ,
[ClientID] [uniqueidentifier] NULL ,
[PageFieldsID] [uniqueidentifier] NULL ,
[EntryTime] [datetime] NOT NULL ,
[ClientCreditorID] [uniqueidentifier] NULL ,
[CodeHistoryIDValue] [uniqueidentifier] NULL ,
[BoolValue] [bit] NULL ,
[IntValue] [int] NULL ,
[CharValue] [varchar] (7000) COLLATE Latin1_General_CI_AS NULL ,
[CurrencyValue] [int] NULL ,
[AddInfo] [varchar] (255) COLLATE Latin1_General_CI_AS NULL ,
[AuditType] [tinyint] NOT NULL ,
[AgreementThreshold] [tinyint] NULL ,
[DateValue] [datetime] NULL ,
[ClientAnswersID] [uniqueidentifier] NULL ,
[CounsellorClientSessionID] [uniqueidentifier] NULL ,
[ClientRecommendationsID] [uniqueidentifier] NULL ,
[DbOpType] [tinyint] NOT NULL ,
[DataItemID] [uniqueidentifier] NULL ,
[Index] [tinyint] NULL ,
[Status] [tinyint] NULL ,
[TypeRequired] [varchar] (10) COLLATE Latin1_General_CI_AS NULL ,
[Guideline_Min] [int] NULL ,
[Guideline_Max] [int] NULL ,
[Guideline_Default] [int] NULL
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[SessionAudit] ADD
CONSTRAINT [DF_SessionAudit_NewSessionAuditId] DEFAULT
(convert(uniqueidentifier,(convert(binary(10),newid()) +
convert(binary(6),getdate())))) FOR [SessionAuditID],
CONSTRAINT [DF_SessionAudit_EntryTime] DEFAULT (getdate()) FOR
[EntryTime],
CONSTRAINT [DF__SessionAu__Audit__33F7DE85] DEFAULT (0) FOR
[AuditType],
CONSTRAINT [DF__SessionAu__Agree__36D44B30] DEFAULT (0) FOR
[AgreementThreshold],
CONSTRAINT [DF__SessionAu__DbOpT__14F43478] DEFAULT (0) FOR
[DbOpType],
CONSTRAINT [DF__SessionAu__Index__15E858B1] DEFAULT (0) FOR [Index],
CONSTRAINT [DF__SessionAu__Statu__16DC7CEA] DEFAULT (0) FOR [Status],
CONSTRAINT [PK_SessionAudit] PRIMARY KEY CLUSTERED
(
[SessionAuditID]
) ON [PRIMARY] ,
CONSTRAINT [CK_SessionAudit_Guidelines] CHECK ([Guideline_Min] is
null and [Guideline_Max] is null and [Guideline_Default] is null or
[Guideline_Min] is not null and [Guideline_Max] is not null and
[Guideline_Default] is not null and [TypeRequired] = 'CURRENCY' and
[Guideline_Min] <= [Guideline_Max]),
CONSTRAINT [CK_SessionAudit_ValidAuditTypes] CHECK ([AuditType] = 7
or ([AuditType] = 6 or ([AuditType] = 5 or ([AuditType] = 4 or
([AuditType] = 3 or ([AuditType] = 2 or ([AuditType] = 1 or
[AuditType] = 0))))))),
CONSTRAINT [CK_SessionAudit_ValidDbOpTypes] CHECK ([DbOpType] = 5 or
([DbOpType] = 4 or ([DbOpType] = 3 or ([DbOpType] = 2 or ([DbOpType] =
1 or [DbOpType] = 0))))),
CONSTRAINT [CK_SessionAudit_ValidTypes] CHECK ([TypeRequired] =
'BOOL' and [BoolValue] is not null and [IntValue] is null and
[CharValue] is null and [CurrencyValue] is null and [DateValue] is
null and ([Status] = 6 or ([Status] = 3 or ([Status] = 2 or ([Status]
= 1 or [Status] = 0)))) or [TypeRequired] = 'CHAR' and [BoolValue] is
null and [IntValue] is null and [CharValue] is not null and
[CurrencyValue] is null and [DateValue] is null and ([Status] = 6 or
([Status] = 3 or ([Status] = 2 or ([Status] = 1 or [Status] = 0)))) or
[TypeRequired] = 'INT' and [BoolValue] is null and [IntValue] is not
null and [CharValue] is null and [CurrencyValue] is null and
[DateValue] is null and ([Status] = 6 or ([Status] = 3 or ([Status] =
2 or ([Status] = 1 or [Status] = 0)))) or [TypeRequired] = 'CURRENCY'
and [BoolValue] is null and [IntValue] is null and [CharValue] is null
and [CurrencyValue] is not null and [DateValue] is null and ([Status]
= 6 or ([Status] = 3 or ([Status] = 2 or ([Status] = 1 or [Status] =
0)))) or [TypeRequired] = 'CODEID' and [BoolValue] is null and
[IntValue] is null and [CharValue] is null and [CurrencyValue] is null
and [DateValue] is null and ([Status] = 6 or ([Status] = 3 or
([Status] = 2 or ([Status] = 1 or [Status] = 0)))) or [TypeRequired] =
'DATE' and [BoolValue] is null and [IntValue] is null and [CharValue]
is null and [CurrencyValue] is null and [DateValue] is not null and
([Status] = 6 or ([Status] = 3 or ([Status] = 2 or ([Status] = 1 or
[Status] = 0)))) or [TypeRequired] is null and [BoolValue] is null and
[IntValue] is null and [CharValue] is null and [CurrencyValue] is null
and [DateValue] is null and [Status] is null)
GO

But I'd expect if it was a schema issue, then my existing subscription
(created some many moons ago) would not work either.

I'll try the BCP thing, but it'll take a while cos space is tight on
the server and this particular table is ~8GB.

Damien
Re: string data, right truncation, not collation issue Damien
9/3/2007 2:08:14 AM
[quoted text, click to view]

On reflection, it appears that there are network issues, and I was
using my md5 tool incorrectly. Looks like the server is incapable of
copying files to other servers without introducing corruption.

Given I can't seem to do this, I'm going to move onto my plan B, which
will be the first time I try to use transactional replication, so I'll
probably be asking more questions on here soon.

Thanks to Hilary (plus anyone else who's replies I haven't seen yet)
for taking the time.

Damien
AddThis Social Bookmark Button