Friday, February 24, 2012

Distribution Agent Fails on Pull subscriptions

Environment:
SQLServer 2000 Enterprise w/SP3
Win 2000 Server w/SP3
In testing replication against a copy of our production database, when I run
the snapshot agent, it completes with success. When I then run the
distribution agent, I get the following error returned:
The name ' ' is not permitted in this context. Only constants, expressions,
or variables allowed here. Column names are not permitted.
(Source: STAGING2 (Data source); Error number: 128)
As near as I can tell, the script being processed when the error is
generated is:
================================================== ==
SET QUOTED_IDENTIFIER ON
GO
drop procedure [spBDCInsertAddressRecord]
GO
CREATE PROCEDURE [spBDCInsertAddressRecord] @.pAddress_id_out int OUT
AS
/************************************************** ************************************************** ******
INSERTS A BLANK ADDRESS RECORD AND RETURNS THE ADDRESS_ID VALUE
************************************************** ************************************************** *******/
INSERT INTO ADDRESS (LINE1) VALUES(" ")
SELECT @.pAddress_id_out = @.@.IDENTITY
RETURN 0
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
================================================== =
This is a Transactional replication and the subscription is a Pull
subscription. The address_id column is the primary key for the table and is
an automatically generated INT data type.
Any thoughts?
TIA,
Ken
Try using INSERT INTO ADDRESS (LINE1) VALUES(' ') -- ie single quotes
Rgds,
Paul Ibison
"kmkrause2" <kmkrause2@.discussions.microsoft.com> wrote in message
news:3C35C8AF-8CD0-44E7-898C-BBF2C0978F5E@.microsoft.com...
> Environment:
> SQLServer 2000 Enterprise w/SP3
> Win 2000 Server w/SP3
> In testing replication against a copy of our production database, when I
run
> the snapshot agent, it completes with success. When I then run the
> distribution agent, I get the following error returned:
> The name ' ' is not permitted in this context. Only constants,
expressions,
> or variables allowed here. Column names are not permitted.
> (Source: STAGING2 (Data source); Error number: 128)
> As near as I can tell, the script being processed when the error is
> generated is:
> ================================================== ==
> SET QUOTED_IDENTIFIER ON
> GO
> drop procedure [spBDCInsertAddressRecord]
> GO
> CREATE PROCEDURE [spBDCInsertAddressRecord] @.pAddress_id_out int OUT
> AS
>
/************************************************** *************************
*******************************
> INSERTS A BLANK ADDRESS RECORD AND RETURNS THE ADDRESS_ID VALUE
>
************************************************** **************************
*******************************/
> INSERT INTO ADDRESS (LINE1) VALUES(" ")
> SELECT @.pAddress_id_out = @.@.IDENTITY
> RETURN 0
> GO
> SET QUOTED_IDENTIFIER OFF
> GO
> SET ANSI_NULLS ON
> GO
> ================================================== =
> This is a Transactional replication and the subscription is a Pull
> subscription. The address_id column is the primary key for the table and
is
> an automatically generated INT data type.
> Any thoughts?
> TIA,
> Ken

No comments:

Post a Comment