Showing posts with label app. Show all posts
Showing posts with label app. Show all posts

Tuesday, March 27, 2012

Configuration file for reporting server project

Hi!
Is it somehow possible to create a configuration file for a reporting server
project. Something similar like the web.config or app.config file in .NET
applications?
What I wanna do is to store the link of a picture file. I don't want to
hard-code that in every report.
Are there any other options than storing this link in a config file?
Cheers, RogerOn Jul 17, 8:37 am, "Roger Frei" <s...@.hotmail.com> wrote:
> Hi!
> Is it somehow possible to create a configuration file for a reporting server
> project. Something similar like the web.config or app.config file in .NET
> applications?
> What I wanna do is to store the link of a picture file. I don't want to
> hard-code that in every report.
> Are there any other options than storing this link in a config file?
> Cheers, Roger
What you could try doing is include a link to a picture file in a
report and then check the XML structure of the underlying RDL file in
a text editor (Notepad, Wordpad, etc). Then change the path in the RDL
file via a custom application that creates the RDL file on the fly.
This might be a bit tedious but it may be the only option.
Regards,
Enrique Martinez
Sr. Software Consultant|||On Jul 17, 2:37 pm, "Roger Frei" <s...@.hotmail.com> wrote:
> Hi!
> Is it somehow possible to create a configuration file for a reporting server
> project. Something similar like the web.config or app.config file in .NET
> applications?
> What I wanna do is to store the link of a picture file. I don't want to
> hard-code that in every report.
> Are there any other options than storing this link in a config file?
> Cheers, Roger
Roger,
Add the picture file to your report project - deploy and hide - no ?

Thursday, March 22, 2012

Conditionally required field

How can I make a field required based on the status of other fields? I have
a Users table for my app that I also reference in forms that are filled out
by everyone. Most users don't need to use this table for login, so they
don't require a password. Each user has a UserName, Password, and a bit for
each privelege that I offer. If all priveleges are 0, I want to make the
password an optional field so I don't have to some up with a bunch of
passwords or use a random character generator. However, if they do have
priveleges, they are required to have a password so that if someone finds ou
t
their UserName (not hard at all), they still can't log in under a priveleged
account.
Thanks in advance
Chris Lieb
UPS CACH, Hodgekins, IL
Tech Support Group - Systems/AppsRules.
Most people thing of rules in an IF.. THEN format which simply won't work.
Think of a rule as a boolean function where YES/TRUE accepts the row and
NO/FALSE rejects the row. Your requirements would lead to a rule like this:
Priv1 <> 0 OR Priv2<> 0 OR PRiv3 <> 0 OR Password <> ''
Look up CREATE RULE and sp_bindrule in BOL for syntax details.
Geoff N. Hiten
Microsoft SQL Server MVP
"Chris Lieb" <ChrisLieb@.discussions.microsoft.com> wrote in message
news:848BFC64-0105-42CC-8F1D-E1C4BAF25D1E@.microsoft.com...
> How can I make a field required based on the status of other fields? I
> have
> a Users table for my app that I also reference in forms that are filled
> out
> by everyone. Most users don't need to use this table for login, so they
> don't require a password. Each user has a UserName, Password, and a bit
> for
> each privelege that I offer. If all priveleges are 0, I want to make the
> password an optional field so I don't have to some up with a bunch of
> passwords or use a random character generator. However, if they do have
> priveleges, they are required to have a password so that if someone finds
> out
> their UserName (not hard at all), they still can't log in under a
> priveleged
> account.
> Thanks in advance
> --
> Chris Lieb
> UPS CACH, Hodgekins, IL
> Tech Support Group - Systems/Apps|||Look up CHECK constraints in SQL Server Books Online. You can easily write
one up based on the column values in a single row.
Anith|||Try:
create table t
(
PK int primary key
, UserID char (5) not null
, Password varchar (15) null
, priv1 bit not null
, priv2 bit not null
, priv3 bit not null
, constraint CK_t check (
case
when cast (priv1 as int) + priv2 + priv3 = 0 then 1
when Password is not null then 1
else 0
end = 1)
)
go
insert t values (1, 'Me', null, 0, 0, 0)
insert t values (2, 'You', null, 1, 0, 0) -- fails
insert t values (3, 'Him', 'pwd', 1, 0, 0)
go
drop table t
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
.
"Chris Lieb" <ChrisLieb@.discussions.microsoft.com> wrote in message
news:848BFC64-0105-42CC-8F1D-E1C4BAF25D1E@.microsoft.com...
How can I make a field required based on the status of other fields? I have
a Users table for my app that I also reference in forms that are filled out
by everyone. Most users don't need to use this table for login, so they
don't require a password. Each user has a UserName, Password, and a bit for
each privelege that I offer. If all priveleges are 0, I want to make the
password an optional field so I don't have to some up with a bunch of
passwords or use a random character generator. However, if they do have
priveleges, they are required to have a password so that if someone finds
out
their UserName (not hard at all), they still can't log in under a priveleged
account.
Thanks in advance
Chris Lieb
UPS CACH, Hodgekins, IL
Tech Support Group - Systems/Apps

Thursday, March 8, 2012

Conditional join?

I have a dropdown box in a .net app that I am populating from a couple
tables.
One is a salesrep table, with the sales rep code and a name in it.
The other table is a table with a sold to sales rep code and a ship to
sales rep code - which may not always be the same in both these columns.
One of those two columns will be in the salesrep table.
Is there a way to do a join on the first table from the second?
Basically, I want to pick out a statement like:
select repname from salesrep_table
inner join sourcetable on
sourcetable.soldtorepcode = salesrep_table.repcode or
sourcetable.shiptorepcode = salesrep_table.repcode
In other words, I want to show this repname in a box when the repcode
that is selected is in either the soldto repcode column, or the shipto
repcode table.
Wiil this work? If not, how would you go about doing this?
Any help would be appreciated.
BC>> I have a dropdown box in a .net app that I am populating from a couple ta
bles. <<
This is a database group and we do not care about the front end. The
basic principle of a tiered architecture is that display and input are
done in the front end and never in the back end. This a more basic
programming principle than just SQL and RDBMS.
This is a major screw up. There is no LOGICAL difference in these
guys. A sales rep is a sales rep; if you want to flag with a role,
then that goes into a column, not a separate table.
Look up "attribute splitting" as a design error.|||Hi Blasting Cap,
This help?
select repname
from salesrep_table as st
inner join sourcetable t on st.repcode = coalesce( t.soldtorepcode,
t.shiptorepcode )
Tony.
Tony Rogerson
SQL Server MVP
http://sqlblogcasts.com/blogs/tonyrogerson - technical commentary from a SQL
Server Consultant
http://sqlserverfaq.com - free video tutorials
"Blasting Cap" <goober@.christian.net> wrote in message
news:OiYTzAWmGHA.1568@.TK2MSFTNGP05.phx.gbl...
>I have a dropdown box in a .net app that I am populating from a couple
>tables.
> One is a salesrep table, with the sales rep code and a name in it.
> The other table is a table with a sold to sales rep code and a ship to
> sales rep code - which may not always be the same in both these columns.
> One of those two columns will be in the salesrep table.
> Is there a way to do a join on the first table from the second?
> Basically, I want to pick out a statement like:
> select repname from salesrep_table
> inner join sourcetable on
> sourcetable.soldtorepcode = salesrep_table.repcode or
> sourcetable.shiptorepcode = salesrep_table.repcode
> In other words, I want to show this repname in a box when the repcode that
> is selected is in either the soldto repcode column, or the shipto repcode
> table.
> Wiil this work? If not, how would you go about doing this?
> Any help would be appreciated.
> BC|||> This is a database group and we do not care about the front end. The
> basic principle of a tiered architecture is that display and input are
> done in the front end and never in the back end. This a more basic
> programming principle than just SQL and RDBMS.
Check the group title AGAIN -> MICROSOFT.SQLSERVER.PROGRAMMING
SQL Server is not just a database rather RDBMS - its a data processing
engine with many different features other than just SQL and store/retrieve.
If you don't like the posts then keep your gob shut and don't answer them!
Tony Rogerson
SQL Server MVP
http://sqlblogcasts.com/blogs/tonyrogerson - technical commentary from a SQL
Server Consultant
http://sqlserverfaq.com - free video tutorials
"--CELKO--" <jcelko212@.earthlink.net> wrote in message
news:1151366508.537061.16560@.m73g2000cwd.googlegroups.com...
> This is a database group and we do not care about the front end. The
> basic principle of a tiered architecture is that display and input are
> done in the front end and never in the back end. This a more basic
> programming principle than just SQL and RDBMS.
>
> This is a major screw up. There is no LOGICAL difference in these
> guys. A sales rep is a sales rep; if you want to flag with a role,
> then that goes into a column, not a separate table.
> Look up "attribute splitting" as a design error.
>|||On 26 Jun 2006 17:01:48 -0700, "--CELKO--" <jcelko212@.earthlink.net>
wrote:

>This is a database group and we do not care about the front end. The
>basic principle of a tiered architecture is that display and input are
>done in the front end and never in the back end. This a more basic
>programming principle than just SQL and RDBMS.
The questions was not about how to program the front end, it was
simply about database retrieval. Mentioning the front end when
describing the query requirement and asking for help with the query is
not a problem.

>This is a major screw up. There is no LOGICAL difference in these
>guys. A sales rep is a sales rep; if you want to flag with a role,
>then that goes into a column, not a separate table.
>Look up "attribute splitting" as a design error.
Nonsense. This exact configuration occured where I worked, and was an
important BUSINESS REQUIREMENT. Surely you remember that the database
must model the business? The salesman who walked into the customer's
headquarters and made a sale that resulted in orders going to hundreds
of stores received credit for the sale. However, each store (shipto)
was also associated with a local salesman. Sales reporting required
tracking BOTH associations, the appropriate one chosen for any given
report.
Roy Harvey
Beacon Falls, CT|||Tony:
Thanks for the help..
It does what it is supposed to do - but not exactly what I want.
The table structure is sort of like this:
Cust No SoldtoRep ShiptoRep SoldToGrp ShiptoGrp
Cust1 Rep1 Rep1 Grp1 Grp1
Cust2 Rep1 Rep2 Grp1 Grp2
Cust3 Rep1 Rep3 Grp1 Grp3
Cust4 Rep4 Rep4 Grp2 Grp2
Because Coalesce returns the first non-null value, it returns Rep1 in
the query when I actually want Reps 1, 2 & 3 to show up. I am going to
use this same thing when determining which groups I want to show up, too.
I believe if I reverse the columns (shipto first, soldto second), it may
do exactly what I wanted.
Many many thanks for your succinct help.
BC

> Hi Blasting Cap,
> This help?
> select repname
> from salesrep_table as st
> inner join sourcetable t on st.repcode = coalesce( t.soldtorepcode,
> t.shiptorepcode )
> Tony.
>|||Hi BC,
If you get stuck just post another thread - good luck.
Tony.
Tony Rogerson
SQL Server MVP
http://sqlblogcasts.com/blogs/tonyrogerson - technical commentary from a SQL
Server Consultant
http://sqlserverfaq.com - free video tutorials
"Blasting Cap" <goober@.christian.net> wrote in message
news:O3esDoemGHA.4816@.TK2MSFTNGP03.phx.gbl...
> Tony:
> Thanks for the help..
> It does what it is supposed to do - but not exactly what I want.
> The table structure is sort of like this:
> Cust No SoldtoRep ShiptoRep SoldToGrp ShiptoGrp
> Cust1 Rep1 Rep1 Grp1 Grp1
> Cust2 Rep1 Rep2 Grp1 Grp2
> Cust3 Rep1 Rep3 Grp1 Grp3
> Cust4 Rep4 Rep4 Grp2 Grp2
> Because Coalesce returns the first non-null value, it returns Rep1 in the
> query when I actually want Reps 1, 2 & 3 to show up. I am going to use
> this same thing when determining which groups I want to show up, too.
> I believe if I reverse the columns (shipto first, soldto second), it may
> do exactly what I wanted.
> Many many thanks for your succinct help.
> BC
>
>

Sunday, February 19, 2012

Concurrent MSDE SQL and SQL 2000/2005

We have two servers that need to be upgraded. One has an app that uses the
MSDE version of SQL. The second uses SQL 2000. Neither has very many users
.
Could we purchase a single new server, and run both versions of SQL on it
concurrently? Would it make a difference if the SQL 2000 is eventually
upgraded to SQL 2005, while the MSDE version stays at 2000 instead of going
to SQL Express?
Thanks!
EmilyYou could run both versions on one server, but it would require having
a named instance, which adds a little bit more hassle. One would be
the default instance and you would connect to it as per normal but the
for the named instance you would have to connect to it as
ComputerName\InstanceName. My recommendation would be to just install
SQL 2000/2005 on your new server and host all databases on the one
instance. Is their any particular reason you want them on seperate
instances?|||Thank you for your response, Paul. My hesitation in using two instances is
simply that I am new to SQL, and new to these applications, and there isn't
anyone here who knows much about them. Having never had SQL training, I am
a
little reluctant to change any of the default settings. However, the
financial people don't want to buy two servers. The vendors are not very
helpful.
"Paul T." wrote:

>
> You could run both versions on one server, but it would require having
> a named instance, which adds a little bit more hassle. One would be
> the default instance and you would connect to it as per normal but the
> for the named instance you would have to connect to it as
> ComputerName\InstanceName. My recommendation would be to just install
> SQL 2000/2005 on your new server and host all databases on the one
> instance. Is their any particular reason you want them on seperate
> instances?
>|||If you are reluctant to change default settings, and you have not had
much SQL training your best bet is to continue using the two servers
and upgrade either as needed. If you wanted them on the same server
you would have to change the default settings of at least one instance
as it would need an instance name. If you moved the msde databases
onto the SQL 2000 server, you would need to at least know how to attach
and detach the databases and ensure that all the logins still have the
proper access. If there is no business reason that these applications
are running on seperate servers then I would look into learning enough
about SQL Server to put the databases on the SQL Server 2000 box
together.|||You could run both versions on one server, but it would require having
a named instance, which adds a little bit more hassle. One would be
the default instance and you would connect to it as per normal but the
for the named instance you would have to connect to it as
ComputerName\InstanceName. My recommendation would be to just install
SQL 2000/2005 on your new server and host all databases on the one
instance. Is their any particular reason you want them on seperate
instances?|||Thank you for your response, Paul. My hesitation in using two instances is
simply that I am new to SQL, and new to these applications, and there isn't
anyone here who knows much about them. Having never had SQL training, I am
a
little reluctant to change any of the default settings. However, the
financial people don't want to buy two servers. The vendors are not very
helpful.
"Paul T." wrote:

>
> You could run both versions on one server, but it would require having
> a named instance, which adds a little bit more hassle. One would be
> the default instance and you would connect to it as per normal but the
> for the named instance you would have to connect to it as
> ComputerName\InstanceName. My recommendation would be to just install
> SQL 2000/2005 on your new server and host all databases on the one
> instance. Is their any particular reason you want them on seperate
> instances?
>|||If you are reluctant to change default settings, and you have not had
much SQL training your best bet is to continue using the two servers
and upgrade either as needed. If you wanted them on the same server
you would have to change the default settings of at least one instance
as it would need an instance name. If you moved the msde databases
onto the SQL 2000 server, you would need to at least know how to attach
and detach the databases and ensure that all the logins still have the
proper access. If there is no business reason that these applications
are running on seperate servers then I would look into learning enough
about SQL Server to put the databases on the SQL Server 2000 box
together.

Concurrent MSDE SQL and SQL 2000/2005

We have two servers that need to be upgraded. One has an app that uses the
MSDE version of SQL. The second uses SQL 2000. Neither has very many users.
Could we purchase a single new server, and run both versions of SQL on it
concurrently? Would it make a difference if the SQL 2000 is eventually
upgraded to SQL 2005, while the MSDE version stays at 2000 instead of going
to SQL Express?
Thanks!
EmilyYou could run both versions on one server, but it would require having
a named instance, which adds a little bit more hassle. One would be
the default instance and you would connect to it as per normal but the
for the named instance you would have to connect to it as
ComputerName\InstanceName. My recommendation would be to just install
SQL 2000/2005 on your new server and host all databases on the one
instance. Is their any particular reason you want them on seperate
instances?|||Thank you for your response, Paul. My hesitation in using two instances is
simply that I am new to SQL, and new to these applications, and there isn't
anyone here who knows much about them. Having never had SQL training, I am a
little reluctant to change any of the default settings. However, the
financial people don't want to buy two servers. The vendors are not very
helpful.
"Paul T." wrote:
>
> You could run both versions on one server, but it would require having
> a named instance, which adds a little bit more hassle. One would be
> the default instance and you would connect to it as per normal but the
> for the named instance you would have to connect to it as
> ComputerName\InstanceName. My recommendation would be to just install
> SQL 2000/2005 on your new server and host all databases on the one
> instance. Is their any particular reason you want them on seperate
> instances?
>|||If you are reluctant to change default settings, and you have not had
much SQL training your best bet is to continue using the two servers
and upgrade either as needed. If you wanted them on the same server
you would have to change the default settings of at least one instance
as it would need an instance name. If you moved the msde databases
onto the SQL 2000 server, you would need to at least know how to attach
and detach the databases and ensure that all the logins still have the
proper access. If there is no business reason that these applications
are running on seperate servers then I would look into learning enough
about SQL Server to put the databases on the SQL Server 2000 box
together.

Sunday, February 12, 2012

Concatinating child field

I'm developing an ASP.NET app with SQL back end. I'm trying to develop a use
r
interface that must reference information from two related tables and would
like to return the following (either in table, but preferably in datagrid):
ParentField1 ParentField2 Parent Field3 ChildField1Record1
ChildField1Record2
ChildField1Record3
ParentField1 ParentField2 ParentField3 ChildFeld1Record4
ChildFeld1Record5
ChildField1Record6 etc.
Is there anyway to write a TSQL function to concatinate the child records
into a dynamic field (there are about 400 parent records)
I could create a denormalized table that mimics the child table by has the
ParentID and ChildRecords concatinated that gets updated everytime the child
table changes, but that's just bad programming!
Any suggestions would be greatly appreciated.
Thanks in advance.well the question is not clear to me. but i guess u are trying to concatinat
e
the fields in the query
ucan do it as
select <field1> + <field2> + ..
FROM <Table>
please let me know if u have any questions
best Regards,
Chandra
http://chanduas.blogspot.com/
http://www.SQLResource.com/
---
"AbeR" wrote:

> I'm developing an ASP.NET app with SQL back end. I'm trying to develop a u
ser
> interface that must reference information from two related tables and woul
d
> like to return the following (either in table, but preferably in datagrid)
:
> ParentField1 ParentField2 Parent Field3 ChildField1Record1
> ChildField1Record2
> ChildField1Record3
> ParentField1 ParentField2 ParentField3 ChildFeld1Record4
> ChildFeld1Record5
> ChildField1Record6 etc.
> Is there anyway to write a TSQL function to concatinate the child records
> into a dynamic field (there are about 400 parent records)
> I could create a denormalized table that mimics the child table by has the
> ParentID and ChildRecords concatinated that gets updated everytime the chi
ld
> table changes, but that's just bad programming!
> Any suggestions would be greatly appreciated.
> Thanks in advance.|||Hi Chandra,
Thanks for the response, and sorry for not being clear. Actually I am trying
to return contents of all records with the ParentID from the child table wit
h
the parent record from the parent table, so actually want to select
record1field1 + record2field1 + record3field1 from chldtable joining
parenttable without repeating the parent data for each record.
Regards,
AbeR
"Chandra" wrote:
> well the question is not clear to me. but i guess u are trying to concatin
ate
> the fields in the query
> ucan do it as
> select <field1> + <field2> + ..
> FROM <Table>
> please let me know if u have any questions
>
> --
> best Regards,
> Chandra
> http://chanduas.blogspot.com/
> http://www.SQLResource.com/
> ---
>
> "AbeR" wrote:
>|||>> Is there anyway to write a TSQL function to concatinate the child records
The terminology you used is a bit confusing.
Assuming that there is a one-to-many relationship that exist between the
tables, what you seem to be asking is to return a resultset with the single
value from the referenced table and all the values from the referencing
table as a contenated string. In general, such processing which demand heavy
looping and formatting of values should be done on the client side -- quite
often one should be able to leverage the functionality of a programming
language or a report-writer in such cases.
Doing this on the server often requires procedural logic, often disguised as
a user defined function or perhaps cursors. For some such workarounds, refer
to: http://tinyurl.com/aka4u
Anith|||Exactly. I was hoping not to create another dataset on the client system, bu
t
that's probably the best approach (While loops in C# within the app)...
DataSet1 will be read by the client and produce dataset two with all the
values from the referenced table as one string and then present in a datagri
d.
Many thanks for the advice and reference.
- AbeR
"Anith Sen" wrote:

> The terminology you used is a bit confusing.
> Assuming that there is a one-to-many relationship that exist between the
> tables, what you seem to be asking is to return a resultset with the singl
e
> value from the referenced table and all the values from the referencing
> table as a contenated string. In general, such processing which demand hea
vy
> looping and formatting of values should be done on the client side -- quit
e
> often one should be able to leverage the functionality of a programming
> language or a report-writer in such cases.
> Doing this on the server often requires procedural logic, often disguised
as
> a user defined function or perhaps cursors. For some such workarounds, ref
er
> to: http://tinyurl.com/aka4u
> --
> Anith
>
>