Re: Stored Procedure Error
- From: "A. Robinson" <ARobinson@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 22 Apr 2005 07:53:03 -0700
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
"Hilary Cotter" wrote:
> 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
>
>
.
- Follow-Ups:
- Re: Stored Procedure Error
- From: Raymond Mak [MSFT]
- Re: Stored Procedure Error
- References:
- Stored Procedure Error
- From: A. Robinson
- Re: Stored Procedure Error
- From: Hilary Cotter
- Stored Procedure Error
- Prev by Date: Re: How To set up Replication for this really daring (poor) Archit
- Next by Date: checking the status of merge agent
- Previous by thread: Re: Stored Procedure Error
- Next by thread: Re: Stored Procedure Error
- Index(es):
Relevant Pages
|