all groups > sql server replication > april 2005 >
You're in the

sql server replication

group:

Stored Procedure Error


Stored Procedure Error A. Robinson
4/21/2005 10:41:02 AM
sql server replication:
I'm encountering an error while trying to apply an initial snapshot to a
subscriber. The table scripts applied just fine, but when the agent tried to
apply the scripts for the stored procedures, I get the following errors:

Cannot use empty object or column names. Use a single space if necessary.
(Source: VIRTUALSERVER1 (Data source); Error number: 1038)
---------------------------------------------------------------------------------------------------------------
Cannot use empty object or column names. Use a single space if necessary.
(Source: VIRTUALSERVER1 (Data source); Error number: 1038)
---------------------------------------------------------------------------------------------------------------
The identifier that starts with ' ( a.assmt_type_desc= 'MDS Type 1 A/AO' or
a.assmt_type_desc='MDS Type 2 AM' or a.assmt_type_desc='MDS Type 3 Y/YO'
or a.ass' is too long. Maximum length is 128.
(Source: VIRTUALSERVER1 (Data source); Error number: 103)
---------------------------------------------------------------------------------------------------------------
The identifier that starts with ' and ( (a.medicare_casemix is not null and
a.medicare_casemix <> '' ) or (a.medicaid_casemix is not null and
a.medicaid_casemix ' is too long. Maximum length is 128.
(Source: VIRTUALSERVER1 (Data source); Error number: 103)
---------------------------------------------------------------------------------------------------------------
The identifier that starts with ' a
Left join #SectionV b
on a.ra_id = b.ra_id
left JOIN dbo.ra_assessment
on a.ra_id = ra_assessment.ra_id
and a.res_id = r' is too long. Maximum length is 128.
(Source: VIRTUALSERVER1 (Data source); Error number: 103)
---------------------------------------------------------------------------------------------------------------

Any suggestions??

Re: Stored Procedure Error Hilary Cotter
4/21/2005 7:24:44 PM
please post your publication scripts as well as the schema of the
objects you are replicating here (or send them to me offline)

--
Hilary Cotter
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
Re: Stored Procedure Error A. Robinson
4/22/2005 7:53:03 AM
I'm setting this up through the GUI, not scripts. Unless there is a way to
generate the scripts the EM.

Here is one of the offending procedures:

CREATE PROCEDURE snasp_ASSESSMENT_Get_RaAssmtAnnualAndYearlyStatusReason
@CustID int= Null,
@EntityID int=Null,
@ResID int =Null,
@visitNumb int = Null,
@AssmtStatusCode char(4)=Null,
@AssmtReasonCode char(4)=Null
AS

Declare @strSQL varchar(1000), @strFilter varchar(500)
Declare @ViewName varchar(50), @AssmtSuperClassID int
Create Table #SectionV ( ra_id int)
Set @strSQL = ""
Set @strFilter = ""
Set NOCOUNT ON

Set @ViewName = 'Fed_RaAssmtStatusReasonView'

if @CustID is not Null
Begin
Set @strFilter = "a.cust_id = " + RTrim(convert(varchar(15),@CustID)) + "
AND "
End
if @EntityID is not Null
Set @strFilter = @strFilter + "a.entity_id = " +
RTrim(convert(varchar(15),@EntityID)) + " AND "
if @ResID is not Null
Set @strFilter = @strFilter + "a.res_id = " +
RTrim(Convert(varchar(15),@ResID)) + " AND "
if @visitNumb is not Null
Set @strFilter = @strFilter + "a.visit_numb = " +
RTrim(Convert(varchar(15),@visitNumb)) + " AND "
if @AssmtStatusCode is not Null
Set @strFilter = @strFilter + "a.assmt_status_code = '" +
RTrim(@AssmtStatusCode) + "' AND "
if @AssmtReasonCode is not Null
Set @strFilter = @strFilter + "a.assmt_reason_code = '" +
RTrim(@AssmtReasonCode) + "' AND "

Set @strFilter = @strFilter + " ( a.assmt_type_desc= 'MDS Type 1 A/AO' or
a.assmt_type_desc='MDS Type 2 AM' or a.assmt_type_desc='MDS Type 3 Y/YO'
or a.assmt_type_desc= 'MDS Type 4 YM' ) "
Set @strFilter = @strFilter + " and ( (a.medicare_casemix is not null and
a.medicare_casemix <> '' ) or (a.medicaid_casemix is not null and
a.medicaid_casemix <> '' )) "

--medicare_casemix

Insert Into #SectionV (ra_id )
Select ra_id FROM dbo.FedRaSectionView Where cust_id = @CustID and entity_id
= @EntityID and res_id = @ResID and assmt_section = 'V'

Set @strSQL = "Select a.*, SectionV_Flag = ( Case When b.ra_id is null then
0 else 1 end ) From " + @ViewName + " a Left join #SectionV b on a.ra_id =
b.ra_id Where " + @strFilter + " Order By a.assmt_date desc "

Exec(@strSQL)



GO



[quoted text, click to view]
Re: Stored Procedure Error Raymond Mak [MSFT]
4/22/2005 11:22:11 AM
Replicating stored procedures that use double-quotes (") instead of single
quote for delimiting string literals is (') sadly not supported up to
SQL2000. The code to support this is quite substantial so I doubt it will
ever be back-ported. In the meantime, your only choice is to rewrite the
stored procedures to use ' for delimiting strings. I will let you know if I
ever get the chance to write an automated tool for this.

-Raymond

[quoted text, click to view]
Re: Stored Procedure Error A. Robinson
4/22/2005 12:49:03 PM
That kinda bites....

Thanks Raymond for the explanation...

[quoted text, click to view]
Re: Stored Procedure Error A. Robinson
4/22/2005 12:50:01 PM
That kinda bites...

Thanks for the explanation

[quoted text, click to view]
AddThis Social Bookmark Button