Thursday, March 29, 2012

Embeded case in where clause - causing problems.

Hi.
I have a sp that allows the user to search based on a variable set of parame
ters for example just a home phone or just a buss. phone however when search
ing by last name the user also has to supply the ZIP
optionally he can filter that search by first name or address. I am trying t
o accomplish that by using embede cases - the procedure compiles - but I do
not get the results I want
For example if i pass in '%s%' for @.Lastname and '%1%' for zip - it does not
work - I am sure that are fields with those values in the db
(note: everying worked as expected before I added the embeded cases (and wil
dcard stuff))
the following is the SP - (sorry for the long snippet)
ALTER procedure GetDupCheckResults
(
@.HomePhone varchar(50),
@.BussPhone varchar(50),
@.Email varchar(50),
@.LastName varchar(50),
@.FirstName varchar(50),
@.Address varchar(50),
@.FirmZip varchar(50),
@.PersonZip varchar(50),
@.FirmName varchar(50)
)
as
begin
SELECT nmfid, nmffirst, nmflast, nafcompany, nafadd1, nafadd2, naftype +
' (' + nafdesc + ') ' AS [Adress Type], npfarea + '-' + npfphone AS Phone
FROM
(
select v_nmf_naf_npf_linked.* from
v_nmf_naf_npf_linked inner join
(
Select distinct npfseq from
(
select
npfseq,'HomePhone' FoundSource
from
v_nmf_naf_npf_Linked
where
npfArea + '-' + NPFPhone = @.HomePhone
and
naftype = 'HOME'
and
(
@.HomePhone <> ''
and
@.HomePhone <> '%%'
)
union
select
npfseq,'BussPhone'
from
v_nmf_naf_npf_Linked
where
npfArea+'-'+NPFPhone = @.BussPhone
and
naftype = 'BF'
and
@.BussPhone <> ''
union
select
npfseq,'NameAddress'
from
V_nmf_naf_npf_Linked
where
@.PersonZIP like nafzip
and
@.LastName like nmflast
and
-- optionally allow filter on address and last name
1 =
Case @.Address
When '' then 1
When '%%' then 1 -- when wild cards are in use
Else
(
Case
when @.Address like nafAdd1 then 1
when @.Address like nafAdd2 then 1
else
0
end
)
end
and
1 =
Case @.LastName
When '' then 1
When '%%' then 1
Else
(
Case
when @.Lastname like nmfLast then 1
else 0
end
)
end
and not
(
(@.LastName = '' or @.PersonZip = '')
or
(@.LastName = '%%' or @.PersonZip = '%%')
)
union
select
npfseq,'Company'
from
V_nmf_naf_npf_Linked
where
nafZip like @.FirmZip
and
nafCompany like @.FirmName
and not @.FirmName = ''
and not @.FirmZip = ''
and not @.FirmName = '%%'
and not @.FirmZip = '%%'
)Temptab
)
unionResult on unionResult.npfseq = v_nmf_naf_npf_Linked.npfseq
) dd
end
thank you for slogging thru it.You are sure you have people with the last name '%s%' and zip '%1%'?
What country is this?
Most likely you don't have such data in your database, but that is exactly
what this code will try to find, since your condition (on last name, for
example) is
@.Lastname like nmfLast
While this stored procedure looks far more complicated than it needs to
be, my guess is that you want
nmfLast LIKE @.Lastname
instead of the other way around.
Steve Kass
Drew University
Madler wrote:

>Hi.
>I have a sp that allows the user to search based on a variable set of param
eters for example just a home phone or just a buss. phone however when searc
hing by last name the user also has to supply the ZIP
>optionally he can filter that search by first name or address. I am trying
to accomplish that by using embede cases - the procedure compiles - but I do
not get the results I want
>For example if i pass in '%s%' for @.Lastname and '%1%' for zip - it does no
t work - I am sure that are fields with those values in the db
>(note: everying worked as expected before I added the embeded cases (and wi
ldcard stuff))
>the following is the SP - (sorry for the long snippet)
>ALTER procedure GetDupCheckResults
>(
> @.HomePhone varchar(50),
> @.BussPhone varchar(50),
> @.Email varchar(50),
> @.LastName varchar(50),
> @.FirstName varchar(50),
> @.Address varchar(50),
> @.FirmZip varchar(50),
> @.PersonZip varchar(50),
> @.FirmName varchar(50)
> )
>as
>begin
>SELECT nmfid, nmffirst, nmflast, nafcompany, nafadd1, nafadd2, naftype
+ ' (' + nafdesc + ') ' AS [Adress Type], npfarea + '-' + npfphone AS Phone
>FROM
>(
>select v_nmf_naf_npf_linked.* from
> v_nmf_naf_npf_linked inner join
> (
> Select distinct npfseq from
> (
> select
> npfseq,'HomePhone' FoundSource
> from
> v_nmf_naf_npf_Linked
> where
> npfArea + '-' + NPFPhone = @.HomePhone
> and
> naftype = 'HOME'
> and
> (
> @.HomePhone <> ''
> and
> @.HomePhone <> '%%'
> )
> union
> select
> npfseq,'BussPhone'
> from
> v_nmf_naf_npf_Linked
> where
> npfArea+'-'+NPFPhone = @.BussPhone
> and
> naftype = 'BF'
> and
> @.BussPhone <> ''
> union
> select
> npfseq,'NameAddress'
> from
> V_nmf_naf_npf_Linked
> where
> @.PersonZIP like nafzip
> and
> @.LastName like nmflast
> and
> -- optionally allow filter on address and last name
> 1 =
> Case @.Address
> When '' then 1
> When '%%' then 1 -- when wild cards are in use
> Else
> (
> Case
> when @.Address like nafAdd1 then 1
> when @.Address like nafAdd2 then 1
> else
> 0
> end
> )
> end
> and
> 1 =
> Case @.LastName
> When '' then 1
> When '%%' then 1
> Else
> (
> Case
> when @.Lastname like nmfLast then 1
> else 0
> end
> )
> end
> and not
> (
> (@.LastName = '' or @.PersonZip = '')
> or
> (@.LastName = '%%' or @.PersonZip = '%%')
> )
>
> union
> select
> npfseq,'Company'
> from
> V_nmf_naf_npf_Linked
> where
> nafZip like @.FirmZip
> and
> nafCompany like @.FirmName
> and not @.FirmName = ''
> and not @.FirmZip = ''
> and not @.FirmName = '%%'
> and not @.FirmZip = '%%'
>
> )Temptab
> )
> unionResult on unionResult.npfseq = v_nmf_naf_npf_Linked.npfseq
> ) dd
>end
>
>thank you for slogging thru it.
>
>

Embedding/Distributing SQL Express With A VB Program

If I want to distribute a VB database programm using MSDE I have to install MSDE seperately which can be a challenge for some users. It there a way I could deploy SQL Express with my VB program so the user would not have to do a seperate install? Is this possible in Visual Studio 2003 or do I need 2005?

Thanks

Have a look at the following MSDN Article, http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsse/html/EmSQLExCustApp.asp

sql

Embedding SQL Server Express in the installer

Can we embed the SQL Server Express in the windows installer jsut like the XML files or the Ms access database?You are referring to the windows installer in VS 2005 I suppose ??
It is not possible in the installer of VS 2003, but I suppose it can be done with Whidbey ... I haven't tried it yet though ...|||The following information may provide clarification regarding the same;

Can I redistribute SQL Express?
http://blogs.msdn.com/sqlexpress/archive/2004/07/04/172952.aspx

embedding RS into a java (j2ee) application

Can anyone point me to some useful information on embedding reports into a
java (J2EE) application?
StephanieNot specifically but I can tell you your options. There are three ways to
integrate reports into an application: roll your own with web services, use
URL integration, use the reportviewer control that comes with VS 2005. Of
these you can use the first two. The control is a 2.0 framework control and
is of no use to you.
The easiest is URL access(search BOL for URL).
Report Manager itself uses web services (Report Manager is really just a
portal that ships with RS. It does nothing that you can't do yourself with
published web services)
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Stephanie" <Stephanie@.discussions.microsoft.com> wrote in message
news:015E15B4-EFDB-422C-917E-B6E7ECACACB5@.microsoft.com...
> Can anyone point me to some useful information on embedding reports into a
> java (J2EE) application?
> Stephanie|||Thanks, Bruce. I can see how you can hide the Toolbar if you want to
(&rc:Toolbar=false). Is there a way to hide sections above the toolbar?
Basically, I want the user to only see the Toolbar and below within the app.
Perhaps the application can manage the Back button functionality?
Also, another quick question: Can you hide the report header and footer with
this sort of option or would you have to add hidden parameters to do that?
Some reports are used within the app and outside the app. When inside the
app, I do not want the report header and footer to show. I'm thinking I have
to add yet another hidden parameter.
S.
"Bruce L-C [MVP]" wrote:
> Not specifically but I can tell you your options. There are three ways to
> integrate reports into an application: roll your own with web services, use
> URL integration, use the reportviewer control that comes with VS 2005. Of
> these you can use the first two. The control is a 2.0 framework control and
> is of no use to you.
> The easiest is URL access(search BOL for URL).
> Report Manager itself uses web services (Report Manager is really just a
> portal that ships with RS. It does nothing that you can't do yourself with
> published web services)
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "Stephanie" <Stephanie@.discussions.microsoft.com> wrote in message
> news:015E15B4-EFDB-422C-917E-B6E7ECACACB5@.microsoft.com...
> > Can anyone point me to some useful information on embedding reports into a
> > java (J2EE) application?
> >
> > Stephanie
>
>|||You can hid the parameter area too. This link shows the things you can
control for the html viewer. I tend to hide the parameter area but not the
toolbar.
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/rptsprg9/html/1c3e680a-83ea-4979-8e79-fa2337ae12a3.htm
Correct about the hidden parameter for the report header and footer.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Stephanie" <Stephanie@.discussions.microsoft.com> wrote in message
news:DD1721F3-3164-479A-BB25-AB4218CA6E40@.microsoft.com...
> Thanks, Bruce. I can see how you can hide the Toolbar if you want to
> (&rc:Toolbar=false). Is there a way to hide sections above the toolbar?
> Basically, I want the user to only see the Toolbar and below within the
> app.
> Perhaps the application can manage the Back button functionality?
> Also, another quick question: Can you hide the report header and footer
> with
> this sort of option or would you have to add hidden parameters to do that?
> Some reports are used within the app and outside the app. When inside the
> app, I do not want the report header and footer to show. I'm thinking I
> have
> to add yet another hidden parameter.
> S.
> "Bruce L-C [MVP]" wrote:
>> Not specifically but I can tell you your options. There are three ways to
>> integrate reports into an application: roll your own with web services,
>> use
>> URL integration, use the reportviewer control that comes with VS 2005. Of
>> these you can use the first two. The control is a 2.0 framework control
>> and
>> is of no use to you.
>> The easiest is URL access(search BOL for URL).
>> Report Manager itself uses web services (Report Manager is really just a
>> portal that ships with RS. It does nothing that you can't do yourself
>> with
>> published web services)
>>
>> --
>> Bruce Loehle-Conger
>> MVP SQL Server Reporting Services
>> "Stephanie" <Stephanie@.discussions.microsoft.com> wrote in message
>> news:015E15B4-EFDB-422C-917E-B6E7ECACACB5@.microsoft.com...
>> > Can anyone point me to some useful information on embedding reports
>> > into a
>> > java (J2EE) application?
>> >
>> > Stephanie
>>

Embedding reports in Winform App...

I am looking for options for rendering RDLs in a .Net 1.1 Windows Forms
application using SQL Server 2K.
Thanks everyone.Use fyiReporting component (http://www.fyireporting.com). Is open source and
read RDL files with Windows Forms Viewer component.
[]s
"Terry Mulvany" <terry.mulvany@.rouseservices.com> escreveu na mensagem
news:eh4oCnMqFHA.2072@.TK2MSFTNGP14.phx.gbl...
>I am looking for options for rendering RDLs in a .Net 1.1 Windows Forms
>application using SQL Server 2K.
> Thanks everyone.
>|||Thanks Pedro, do you or anyone else know of any similar 3rd party (pay or
open source) components that actually use the infrastructure of SQL Server
Reporting Services (i.e. ReportServer web service and it's corresponding
security) rather than just simply being able to load an RDL file and view it
as the FYIReporting stuff does.
(I know .Net 2.0 and Yukon will support this but we do not have that as an
option)
Thanks all.
-Terry
"Pedro Jr." <pedro.alvesjr@.gmail.com> wrote in message
news:epT5CvMqFHA.2776@.TK2MSFTNGP10.phx.gbl...
> Use fyiReporting component (http://www.fyireporting.com). Is open source
> and read RDL files with Windows Forms Viewer component.
> []s
>
> "Terry Mulvany" <terry.mulvany@.rouseservices.com> escreveu na mensagem
> news:eh4oCnMqFHA.2072@.TK2MSFTNGP14.phx.gbl...
>>I am looking for options for rendering RDLs in a .Net 1.1 Windows Forms
>>application using SQL Server 2K.
>> Thanks everyone.
>|||You can use web services to return a stream rendered how you want and then
display that (pdf, excel, html, etc). Or you can use URL integration. Put a
IE browser control and set its URL appropriately. With .Net 2.0 where will
be a winform control which will make all of this extremely easy.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Terry Mulvany" <terry.mulvany@.rouseservices.com> wrote in message
news:eh4oCnMqFHA.2072@.TK2MSFTNGP14.phx.gbl...
>I am looking for options for rendering RDLs in a .Net 1.1 Windows Forms
>application using SQL Server 2K.
> Thanks everyone.
>

Embedding reporting services as a standalone product

Hi,
In the application that I am working on, we currently use Crystal Reports as
the embedded reporting engine. I am trying to evaluate if we should move
over to Microsoft Reporting Services. However, one thing confuses me. It
seems Microsoft Reporting Services will work only as a server under IIS.
This will not work for our customers. I am wondering if Reporting Services
has any embedded component much like Crystal Reports that we could use.
Thank you in advance for your help.
SunnyVersion 2 will have a web form and a winform that does not require the
server (works with the server if there but does not require it).
--
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Sansanee" <sansanee@.nospam.com> wrote in message
news:%23LD40RJ3EHA.1144@.TK2MSFTNGP09.phx.gbl...
> Hi,
> In the application that I am working on, we currently use Crystal Reports
as
> the embedded reporting engine. I am trying to evaluate if we should move
> over to Microsoft Reporting Services. However, one thing confuses me. It
> seems Microsoft Reporting Services will work only as a server under IIS.
> This will not work for our customers. I am wondering if Reporting Services
> has any embedded component much like Crystal Reports that we could use.
> Thank you in advance for your help.
> Sunny
>

Embedding plug-ins in Reports

Hi,
I am trying to figure out the way to embed a plug-in (Chime for Windows)
into my report, so that I can display a certain object from a database, that
is stored there as a string. This Chime plug-in would read the input string
and convert it to video display.
This embedding is easily done in simple HTML:
<embed type='chemical/x-mdl-molfile' display2d=true width=200 height=200
hlabels2d='terminalhetero' structure= [encrypted string from the database
follows]>
I am wondering is there a way to do such embedding straight into my report
by using the report designer features or by modifying an RDL file for my
report?
Thank you.
Anton Bagayev,
TransForm Pharmaceuticals, Inc.
29 Hartwell Avenue
Lexington, MA 02421Or even simpler, is it possible to embed an HTML in a report.
That would be an exiting idea.
Thanks in advance.
Anton.
"Anton" wrote:
> Hi,
> I am trying to figure out the way to embed a plug-in (Chime for Windows)
> into my report, so that I can display a certain object from a database, that
> is stored there as a string. This Chime plug-in would read the input string
> and convert it to video display.
> This embedding is easily done in simple HTML:
> <embed type='chemical/x-mdl-molfile' display2d=true width=200 height=200
> hlabels2d='terminalhetero' structure= [encrypted string from the database
> follows]>
> I am wondering is there a way to do such embedding straight into my report
> by using the report designer features or by modifying an RDL file for my
> report?
> Thank you.
> Anton Bagayev,
> TransForm Pharmaceuticals, Inc.
> 29 Hartwell Avenue
> Lexington, MA 02421sql