Re: Stored Procedure Error

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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
>
>
.



Relevant Pages

  • Embedding Perl in C: problem with modules
    ... I need persistent Perl interpreter in my C program and a function, that can run my scripts and can make addition things with data from the script. ... int err = 0; ...
    (perl.beginners)
  • Re: Does Linux not allow use of chmod u+s
    ... To execute scripts with root privaliges as a user you need to ... ]If Linux does not allow that, how do suid and super allow it? ... ]int main ... how buffer overflow attacks are born. ...
    (comp.os.linux.security)
  • Re: Convert CHAR YYYYMMDD to mm/dd/yyyy
    ... I know how to generate CREATE TABLE scripts but is there a fast way to ... DECLARE @dt INT; ... Whenever possible please post enough code to reproduce your problem. ... State what version of SQL Server you are using and specify the content ...
    (comp.databases.ms-sqlserver)
  • Bug in #! processing
    ... options for scripts and such. ... int main(int ac, char **av) ... root@tytus> uname -a ...
    (freebsd-current)