Showing posts with label box. Show all posts
Showing posts with label box. Show all posts

Thursday, March 29, 2012

Configure AWE in SQL Server 2k on Win2k3 Enterprise Server

I just went through configuring windows 2003 server to utilize the full 8gb of RAM on the box for the purpose of enabling sql server 2000 to grab more memory. After setting the /PAE and /3GB switches in the boot file, I set the server options on the sql server to show advanced options, enabled awe memory capability and set sql server to use a constant 3gb of RAM. I received some error messages which I tracked down and, as a result of the solutions I found online, disabled auto shrinking of the databases and also disabled the minimum memory setting for queries
What I found was a problem with, I believe, the lock memory in sql server after making these changes. A complex update query that before the changes would complete in five or six minutes was now not completing after an hour or two...I would have to go into QA and kill the process everytime. After running a trace and running sp_who2, it looked like tens of thousands of locks were being created when the query would run
Now here is my request
Obviously, I missed something in the configuration of the AWE memory in sql server. If anyone can walk me through it I would be most grateful
Thank you
MichaeThis is a multi-part message in MIME format.
--=_NextPart_000_06F0_01C3B362.895E6E60
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
You have 8 GGB on the server, yet configure SQL Server to take "a constant
3gb of RAM". Why? On our cluster, we gave 6.5 GB to SQL Server and the
rest to the OS. Use:
sp_configure 'awe', 6656
... and restart SQL Server.
--
Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"michael weiss" <mhweiss@.hotmail.com> wrote in message
news:2F59D0ED-086F-4BD2-8117-B05882D7F1D4@.microsoft.com...
I just went through configuring windows 2003 server to utilize the full 8gb
of RAM on the box for the purpose of enabling sql server 2000 to grab more
memory. After setting the /PAE and /3GB switches in the boot file, I set the
server options on the sql server to show advanced options, enabled awe
memory capability and set sql server to use a constant 3gb of RAM. I
received some error messages which I tracked down and, as a result of the
solutions I found online, disabled auto shrinking of the databases and also
disabled the minimum memory setting for queries.
What I found was a problem with, I believe, the lock memory in sql server
after making these changes. A complex update query that before the changes
would complete in five or six minutes was now not completing after an hour
or two...I would have to go into QA and kill the process everytime. After
running a trace and running sp_who2, it looked like tens of thousands of
locks were being created when the query would run.
Now here is my request -
Obviously, I missed something in the configuration of the AWE memory in sql
server. If anyone can walk me through it I would be most grateful.
Thank you,
Michael
--=_NextPart_000_06F0_01C3B362.895E6E60
Content-Type: text/html;
charset="Utf-8"
Content-Transfer-Encoding: quoted-printable
=EF=BB=BF<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

You have 8 GGB on the server, yet =configure SQL Server to take "a constant 3gb of RAM". Why? On our cluster, =we gave 6.5 GB to SQL Server and the rest to the OS. Use:
sp_configure 'awe', =6656
... and restart SQL =Server.
-- Tom
---T=homas A. Moreau, BSc, PhD, MCSE, MCDBASQL Server MVPColumnist, SQL =Server ProfessionalToronto, ON Canadahttp://www.pinnaclepublishing.com/sql">www.pinnaclepublishing.com=/sql
"michael weiss" wrote in =message news:2F5=9D0ED-086F-4BD2-8117-B05882D7F1D4@.microsoft.com...I just went through configuring windows 2003 server to utilize the full =8gb of RAM on the box for the purpose of enabling sql server 2000 to grab more =memory. After setting the /PAE and /3GB switches in the boot file, I set the =server options on the sql server to show advanced options, enabled awe memory capability and set sql server to use a constant 3gb of RAM. I received =some error messages which I tracked down and, as a result of the solutions I =found online, disabled auto shrinking of the databases and also disabled the =minimum memory setting for queries.What I found was a problem with, I =believe, the lock memory in sql server after making these changes. A complex update =query that before the changes would complete in five or six minutes was now =not completing after an hour or two...I would have to go into QA and kill =the process everytime. After running a trace and running sp_who2, it looked =like tens of thousands of locks were being created when the query would =run.Now here is my request -Obviously, I missed something in the =configuration of the AWE memory in sql server. If anyone can walk me through it I would =be most grateful.Thank you,Michael

--=_NextPart_000_06F0_01C3B362.895E6E60--|||Thank you, Tom...I used the sp_configure and set the memory to use that way. Then I started to have serious problems with that update query that seemed to be holding locks and not releasing them. Therefore, I wondered if I were missing something or if anyone else has had a similar issue? Reverting back to the original configuration for memory usage (AWE disabled and removing the /PAE and /3GB switches from the boot ini file) fixed the query problem. I am running the latest service packs/updates on both sql server and win2k3 enterprise server.
Thanks,
Michael|||This is a multi-part message in MIME format.
--=_NextPart_000_0775_01C3B368.3E2D1B20
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
Sorry about that. Try:
sp_configure 'awe', 1
reconfigure with override
go
sp_configure 'max server', 6656
reconfigure with override
go
sp_configure 'min server', 0
reconfigure with override
go
Restart SQL Server. That said, it is possible that parallelism caused
degradation of this particular query. If the above doesn't work, try adding
OPTION (MAXDOP 1) at the end of the statement. This turns off parallelism.
--
Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"michael weiss" <mhweiss@.hotmail.com> wrote in message
news:317296B6-5AEE-451A-ABDA-471474D79703@.microsoft.com...
Thank you, Tom...I used the sp_configure and set the memory to use that way.
Then I started to have serious problems with that update query that seemed
to be holding locks and not releasing them. Therefore, I wondered if I were
missing something or if anyone else has had a similar issue? Reverting back
to the original configuration for memory usage (AWE disabled and removing
the /PAE and /3GB switches from the boot ini file) fixed the query problem.
I am running the latest service packs/updates on both sql server and win2k3
enterprise server.
Thanks,
Michael
--=_NextPart_000_0775_01C3B368.3E2D1B20
Content-Type: text/html;
charset="Utf-8"
Content-Transfer-Encoding: quoted-printable
=EF=BB=BF<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

Sorry about that. =Try:
sp_configure 'awe', =1reconfigure with overridegosp_configure 'max server', 6656reconfigure with overridegosp_configure 'min server', 0reconfigure with overridego
Restart SQL Server. That =said, it is possible that parallelism caused degradation of this particular =query. If the above doesn't work, try adding OPTION (MAXDOP 1) at the end of =the statement. This turns off parallelism.
-- Tom
---T=homas A. Moreau, BSc, PhD, MCSE, MCDBASQL Server MVPColumnist, SQL =Server ProfessionalToronto, ON Canadahttp://www.pinnaclepublishing.com/sql">www.pinnaclepublishing.com=/sql
"michael weiss" wrote in =message news:317=296B6-5AEE-451A-ABDA-471474D79703@.microsoft.com...Thank you, Tom...I used the sp_configure and set the memory to use that way. =Then I started to have serious problems with that update query that seemed to =be holding locks and not releasing them. Therefore, I wondered if I were =missing something or if anyone else has had a similar issue? Reverting back to =the original configuration for memory usage (AWE disabled and removing the =/PAE and /3GB switches from the boot ini file) fixed the query problem. I am =running the latest service packs/updates on both sql server and win2k3 enterprise server.Thanks,Michael

--=_NextPart_000_0775_01C3B368.3E2D1B20--|||Tom,
Could parallelism cause the creation of massive quantities of table locks?
Thanks,
Michael|||This is a multi-part message in MIME format.
--=_NextPart_000_0818_01C3B36D.BC615B50
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
It's not uncommon to have parallelized queries run slower than their
single-threaded counterparts. I'm surprised about "massive quantities of
table locks". A query would issue one table lock per table. It could issue
many, many page or row locks, though. Is it possible to specify a table
lock for this query or are others accessing the table at the time?
Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"michael weiss" <anonymous@.discussions.microsoft.com> wrote in message
news:2C7FADE9-E72C-492C-915D-D58458944D89@.microsoft.com...
Tom,
Could parallelism cause the creation of massive quantities of table locks?
Thanks,
Michael
--=_NextPart_000_0818_01C3B36D.BC615B50
Content-Type: text/html;
charset="Utf-8"
Content-Transfer-Encoding: quoted-printable
=EF=BB=BF<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

It's not uncommon to have parallelized =queries run slower than their single-threaded counterparts. I'm surprised =about "massive quantities of table locks". A query would issue one table =lock per table. It could issue many, many page or row locks, =though. Is it possible to specify a table lock for this query or are others =accessing the table at the time?
-- Tom
---T=homas A. Moreau, BSc, PhD, MCSE, MCDBASQL Server MVPColumnist, SQL =Server ProfessionalToronto, ON Canadahttp://www.pinnaclepublishing.com/sql">www.pinnaclepublishing.com=/sql
"michael weiss" wrote in message news:2C7=FADE9-E72C-492C-915D-D58458944D89@.microsoft.com...Tom,Could= parallelism cause the creation of massive quantities of table locks?Thanks,Michael

--=_NextPart_000_0818_01C3B36D.BC615B50--|||Sorry, Tom...I meant page locks, not table locks. My mistake. The query calls a correlated subquery many times depending on the outcome of various CASE statements. Therefore, the table which the subquery pulls data from is queried several times. I just never had any problems before I tried enabling AWE on the sql server
Thanks
Michael|||This is a multi-part message in MIME format.
--=_NextPart_000_089B_01C3B371.9D7C9610
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
OK, have you tried my revised script and re-started SQL Server? Also, it
could be that the query needs a re-write or you may need to tune your
indexing.
--
Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"michael weiss" <anonymous@.discussions.microsoft.com> wrote in message
news:05211AC9-8FF9-4980-AB85-D7262629F027@.microsoft.com...
Sorry, Tom...I meant page locks, not table locks. My mistake. The query
calls a correlated subquery many times depending on the outcome of various
CASE statements. Therefore, the table which the subquery pulls data from is
queried several times. I just never had any problems before I tried enabling
AWE on the sql server.
Thanks,
Michael
--=_NextPart_000_089B_01C3B371.9D7C9610
Content-Type: text/html;
charset="Utf-8"
Content-Transfer-Encoding: quoted-printable
=EF=BB=BF<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

OK, have you tried my revised script =and re-started SQL Server? Also, it could be that the query needs a =re-write or you may need to tune your indexing.
-- Tom
---T=homas A. Moreau, BSc, PhD, MCSE, MCDBASQL Server MVPColumnist, SQL =Server ProfessionalToronto, ON Canadahttp://www.pinnaclepublishing.com/sql">www.pinnaclepublishing.com=/sql
"michael weiss" wrote in message news:052=11AC9-8FF9-4980-AB85-D7262629F027@.microsoft.com...Sorry, Tom...I meant page locks, not table locks. My mistake. The query calls a =correlated subquery many times depending on the outcome of various CASE statements. Therefore, the table which the subquery pulls data from is =queried several times. I just never had any problems before I tried enabling AWE =on the sql server.Thanks,Michael

--=_NextPart_000_089B_01C3B371.9D7C9610--|||Thank you, Tom...I set the server as you suggested including configuring sql server to use 6.5GB of RAM, added the MAXDOP(1) option to the end of the query and it smoked right through 1.5 million records in just over 4 minutes.
Many thanks,
Michael|||P.S. on a related note...
take a look at dbcc sqlperf(waitstats). You should be able to find some
decent info on it if you google it..
Large waittimes with a waittype of cxpacket are often associated with cases
where parallelism is getting bogged down for one reason or another such that
serial plans (or at leat DOP less than number of CPU...) is a good idea...
looking at the waitstats is a nice way to quantitatively predict if lowering
DOP might help...
--
Brian Moran
Principal Mentor
Solid Quality Learning
SQL Server MVP
http://www.solidqualitylearning.com
"michael weiss" <mhweiss@.hotmail.com> wrote in message
news:1D2337B2-D79B-4B8F-975C-12138EBDCEEA@.microsoft.com...
> Thank you, Tom...I set the server as you suggested including configuring
sql server to use 6.5GB of RAM, added the MAXDOP(1) option to the end of the
query and it smoked right through 1.5 million records in just over 4
minutes.
> Many thanks,
> Michael|||This is a multi-part message in MIME format.
--=_NextPart_000_007A_01C3B3F9.C79FC0B0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
Kewl! Glad to have made a difference. You may be able to tweak it more
with some coding and indexing changes.
--
Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"michael weiss" <mhweiss@.hotmail.com> wrote in message
news:1D2337B2-D79B-4B8F-975C-12138EBDCEEA@.microsoft.com...
Thank you, Tom...I set the server as you suggested including configuring sql
server to use 6.5GB of RAM, added the MAXDOP(1) option to the end of the
query and it smoked right through 1.5 million records in just over 4
minutes.
Many thanks,
Michael
--=_NextPart_000_007A_01C3B3F9.C79FC0B0
Content-Type: text/html;
charset="Utf-8"
Content-Transfer-Encoding: quoted-printable
=EF=BB=BF<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

Kewl! Glad to have made a =difference. You may be able to tweak it more with some coding and indexing changes.
-- Tom
---T=homas A. Moreau, BSc, PhD, MCSE, MCDBASQL Server MVPColumnist, SQL =Server ProfessionalToronto, ON Canadahttp://www.pinnaclepublishing.com/sql">www.pinnaclepublishing.com=/sql
"michael weiss" wrote in =message news:1D2=337B2-D79B-4B8F-975C-12138EBDCEEA@.microsoft.com...Thank you, Tom...I set the server as you suggested including configuring sql =server to use 6.5GB of RAM, added the MAXDOP(1) option to the end of the query and =it smoked right through 1.5 million records in just over 4 minutes.Many =thanks,Michael

--=_NextPart_000_007A_01C3B3F9.C79FC0B0--

Tuesday, March 27, 2012

Configuration Manager ?

Each time you start a SSIS project you have Solutions Configuration showing "Development". In the drop down box you can select "Configuration Manager..."

Can someone tell me the use of this, and is it related to the package configurations somehow. I've tried to create new Solution Configurations like "Test" and "Production" with the purpose of binding different configuration files and deplymentfolders to each Solution Configuration but still it seems like this isn't the way i should be used...

This is something inherent to Visual Studio rather than BIDS or SSIS. It doesn't have any relevance to package configurations that we know and love (!!!).

I don't know how this VS feature is supposed to be used so I say whether it would be useful for SSIS or not. I'd like to know though!!!

-Jamie

|||

The only thing i could see any use of this was to create 3 enviroments - Development, Test and Production.

I each of those i'll set the outputpath to bin\Development, bin\Test, bin\Production

So when i build the package i can choose the enviroment to build it to so that i can keep those files sepperate....

|||

Is there a way to reference the current value within a variable ?

This would be helpfull for having the servername depend on the selected configuration.

Thanks in advance,

Geert

|||

What you are asking and what cpgl described seems totally unnecessary if you only use the built in Configuration support for SSIS. Things like file paths are server names should be changed through configurations, not coded into the package during "build".

I would expect each environment to have the required configiration resources in place, so there should be nothing to change in the package to prepare it for an environment. If you do change the package between environments it just defeats the purpose of having a test environment as what you tested is not what you will then promote to production. It may be a minor change, but being strict, no changes should be allowed.

The only exception I can see is when environments are combined on machines, and for that I'd recomend passing in a parameter through the execution host, e.g. DTEXEC /SET

Sunday, March 25, 2012

Config Help for Server2003/sql2000/iis6 Reporting Services

Newbie alert. Need some configuration help please. Have web server with 3
websites on box above with same ip using host headers (well-established sites
working fine). Installed reporting services, went to one website and created
virtual directories with IIS to same folder/name as items under Default Web
Site. Authentication is set to IUSR_svrname, Integrated Windows on website
and virtual directories.
Created a basic report & deployed to http://serverName/reportServer. I can
view report by url similar
to:http://serverName/Reportserver?%2fFolderName%2freportName&rs:Command=Render Data connection and report retrieval is fine.
But, I need folks to be able to enter the www.domainname.com type of url and
that gives me a HTTP Error 403.8 - Forbidden: DNS name of the client is
rejected. As soon as I remove the report services part of the url, site
pops up fine. And, if possible, I'd like to be able to use more than one of
my domains, just referencing the virtual directory in IIS for each site.
Also, I cannot get to the http://serverName/Reports/Pages/Folder.aspx to set
roles and permissions because it only sees me as IUSR and I can't "see"
anything under that role. Even though I'm a domain administrator, believe
it's seeing me as IUSR.
Tried a few things but may be making it worse. Thanks for any advice-would
really like to be able to use this tool, but can't at this point.Update - think I'm really close, but still need help. Uninstalled,
reinstalled RS. Deployed sample. Added <ReportServerExternalURL>
http://www.domainname.org/Reports </ReportServerExternalURL> to
rswebapplication.config Deployed.
Created new role for IUSR_MachineName and gave it browse capabilities on
home folder.
Added virtual directory is IIS under web site above for Reports, with
documents of home.aspx and enable IUSR in IIS for directory. (Deployment is
still okay.) If I view Reports via machinename, site settings are there.
Browse to folder, click on report, the folder pops up again. Report will not
generate. If I view via www, site settings are not there (good, good).
Report does the same thing - popping up another folder view but not
generating.
Added virtual directory is IIS under web site above for ReportServer, with
document sof default.htm, default.asp, index.htm, iisstart.htm, default.aspx.
Same thing happens again.
Think I'm very close. Anybody?|||Finally got a reply on another forum so thought I'd pass it along. Even
though the documentation explicitly says:
"To access a report server on the Internet, you must add a
ReportServerExternalURL configuration setting that specifies the fully
qualified domain name of the report server. The external client uses this
value to access a report server. In this scenario, the browser that is
hosting Report Manager must send a fully qualified domain name when making
requests on behalf of Report Manager to the report server. The following
example illustrates the syntax for ReportServerExternalURL:
<ReportServerExternalURL> reports.adventure-works.com
</ReportServerExternalURL>"
When I replaced the UI with the following, things started rendering properly.
<UI>
<ReportServerVirtualDirectory>/ReportServer</ReportServerVirtualDirectory>
</UI>
Hope it helps out someone else.

Thursday, March 8, 2012

Conditional parameters

I have two parameters, one list box generated from a union dataset, that has
an option to generate the report for all suppliers. When this option is
selected the second parameter (a search parameter, based on user input) must
not allow the input of %, can anyone let me know how this can be achieved.
Also can a error message be displayed when the user inputs a %?
Any help greatly anticipated.
Dave.I assume that you are generating reports directly from the
report manager.
I dont know if there is a direct way of acchieving this
but would like to suggest a work around.
Have an additional text box and type in some error text in
it eg : "Please do not enter %" or "Wrong parameters"
Then set the hidden property of this text box to an
expression that validates the parameter value and hides
the textbox if the values entered are correct otherwise
the textbox is visible.
Then for other controls on the report set the same
condition for visibility but in this case make the
controls visible if the parameters entered are correct
otherwise the controls will be hidden.
So if the user enters a wrong value for the second
parameter then only one textbox will appear asking the
user to enter the values again.
Hope this helps!
>--Original Message--
>I have two parameters, one list box generated from a
union dataset, that has
>an option to generate the report for all suppliers. When
this option is
>selected the second parameter (a search parameter, based
on user input) must
>not allow the input of %, can anyone let me know how this
can be achieved.
>Also can a error message be displayed when the user
inputs a %?
>Any help greatly anticipated.
>Dave.
>.
>

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

Wednesday, March 7, 2012

Conditional formatting on a text box

Hi all -
I have a report that I need to duplicate in RS. What I'm trying to do is put
some conditional formatting on my detail textboxes.
I want the text to be bold if the field = certain things. ie. If the line
detail on the report = "Invoiced Sales", "Trade Sales", "Net Sales"..etc I
need that line to be bolded.
I'm trying to use an IIF statement as an expression for the textbox's
Format/FontWeight property, but am having trouble compiling.
Here's what I've tried:
=IIF(Fields!linedetail.Value = "NET INCOME", fontweight = BOLD, fontweight = NORMAL)
=IIF(Fields!linedetail.Value = "NET INCOME", BOLD, NORMAL)
Of course, I will eventually need to convert this into some kind of OR
statment because there are 7 different possible line details that should be
bolded.
I appreciate any help you could give. Thanks in advance!
-KellyHi Kelly
I have found the following works.
= iif(rtrim(Fields!ObjectCode.Value) = "Your text", "Bold","Normal")
But is has to go in the "FontWeight" property area.
"Kelly" wrote:
> Hi all -
> I have a report that I need to duplicate in RS. What I'm trying to do is put
> some conditional formatting on my detail textboxes.
> I want the text to be bold if the field = certain things. ie. If the line
> detail on the report = "Invoiced Sales", "Trade Sales", "Net Sales"..etc I
> need that line to be bolded.
> I'm trying to use an IIF statement as an expression for the textbox's
> Format/FontWeight property, but am having trouble compiling.
> Here's what I've tried:
> =IIF(Fields!linedetail.Value = "NET INCOME", fontweight = BOLD, fontweight => NORMAL)
> =IIF(Fields!linedetail.Value = "NET INCOME", BOLD, NORMAL)
> Of course, I will eventually need to convert this into some kind of OR
> statment because there are 7 different possible line details that should be
> bolded.
> I appreciate any help you could give. Thanks in advance!
> -Kelly
>
>|||For more complex conditionals you can use switch() in place of an iif(). For
example:
=Switch(Fields!linedetail.Value="Trade Sales", "Bold",
Fields!linedetail.Value="Invoiced Sales", "Bold",
Fields!linedetail.Value="Net Sales", "Normal")
--
Bruce Johnson [MSFT]
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Fiona Harrison" <FionaHarrison@.discussions.microsoft.com> wrote in message
news:9E52BF14-C73D-4C2F-ABC7-5844C6ABBE19@.microsoft.com...
> Hi Kelly
> I have found the following works.
> = iif(rtrim(Fields!ObjectCode.Value) = "Your text", "Bold","Normal")
> But is has to go in the "FontWeight" property area.
> "Kelly" wrote:
>> Hi all -
>> I have a report that I need to duplicate in RS. What I'm trying to do is
>> put
>> some conditional formatting on my detail textboxes.
>> I want the text to be bold if the field = certain things. ie. If the line
>> detail on the report = "Invoiced Sales", "Trade Sales", "Net Sales"..etc
>> I
>> need that line to be bolded.
>> I'm trying to use an IIF statement as an expression for the textbox's
>> Format/FontWeight property, but am having trouble compiling.
>> Here's what I've tried:
>> =IIF(Fields!linedetail.Value = "NET INCOME", fontweight = BOLD,
>> fontweight =>> NORMAL)
>> =IIF(Fields!linedetail.Value = "NET INCOME", BOLD, NORMAL)
>> Of course, I will eventually need to convert this into some kind of OR
>> statment because there are 7 different possible line details that should
>> be
>> bolded.
>> I appreciate any help you could give. Thanks in advance!
>> -Kelly
>>

Friday, February 24, 2012

conditional color property based on date

I want to use an IIF statement to set the color property for a text box.
Here is my code that is not working:
=IIf(DateAdd('m', -6, Fields!Orig_expireDate.Value) <
Now(), "red", "black")Use " instead of '
( ' is a comment for vb, even in reporting services)
Mike G.
"ladydi_1226" <ladydi1226@.discussions.microsoft.com> wrote in message
news:92B486DB-EFFA-49BC-AEE3-76CBBF4A24AE@.microsoft.com...
>I want to use an IIF statement to set the color property for a text box.
> Here is my code that is not working:
> =IIf(DateAdd('m', -6, Fields!Orig_expireDate.Value) <
> Now(), "red", "black")

Tuesday, February 14, 2012

Concurrency issues, tunning, and other suggestions.

Ok, I have a few questions here for whomever can lend a hand:

I use SQL Server 7.0 as a production server on a Compaq Proliant box with three 36GB drives, 3 GB of Ram and 4 pentium 4 processors, yet I'm having horrible concurrency problems. The largest table will hold a million or so records, sometimes it will be joined with other big tables for reporting, which really slow down the database to a crawl.

Question 1. I ran the tunning wizard on a day's worth workfile that I got using the profiler, so far it suggests dumping some indexes but doesn't suggest creating any new ones. Finally it says that after the recomendations are placed on the server the improvement percentage will be 0... Thats right 0% improvement...

Did I do something wrong ? Do I need to run the profiler for a week or so to get a larger workfile ? Does the indexes I have (all non clustered PK's) are enough for my current requirements ? can it be helped ?

Quesiton 2. I figured so far that I can't have OLAP and OLTP on the database at once unless I change all the database design. Our database is heavily used during all week days and there aren't any real schedules for reporting, it all just happens at the same time. How can I improve performace ? Reindexing ? Building extra indexes ? redesigning or denormalizing the database ?

Question 3. I thought about reindexing the tables to use 50% fillfactor. That would give me a balanced performance between frequent inserts/updates (OLTP requests) and similar performance for selects and reporting (OLAP request). Am I right here or have I got it all wrong ?

Question 4. Are there any GOOD comprehensive books you could suggest for intermediate DBA's ? I've read about every piece of SQL Server performance tunning available on forums and the web, altho something has been helpful it still falls short, or I'm not applying it correctly, coz altho I keep the performance from worsening I can't seem to get it to improve.

Thanks,I think you should add a clustered index on every table to speed up selects (it would slow down inserts but in your case that doesent seem to be a major problem).

The server works fine under "normal" work, its just the reports that makes the server crawl?
If thats the case you dont have to remove any indexes, just make sure that the indexes are the right one for your application. Forget about the index tuning wizard, look at your sql-commands instead, Do you have the indexes to match the where clauses in your commands?

Are your sql-commands optimized for parralel query execution? (books online and Execution plan in QA).

Is the server using all 4 proc?

Hopes some of it helps!|||Thank you Jonte!

I'll try adding clustered indexes as I go, we had a bad situation last may where the database was slowed down to a crawl and all the systems were unusable, an outsourcing firm came here and took off all the clustered indexes and made them non clustered...

It didn't help that much, but back then we had to try EVERYTHING! I'll put those back again, as it was proven that the issue was concurrency.

The server works fine under "normal" workload, that is when I don't have the all users at once in the 14 systems that the database serves. But when they're all in together, specially users from accounting and expenses they really give everybody else a headache...

Processes from accounting and expenses are very heavy and resource intensive, and also poorly designed. So they lock tables, and hold to those locks till they finish their transactions, which sometimes takes over 60 seconds!

And when I say it slows down its coz everything starts failing, reports slow down, processes take forever, and user response times go to the roof, hence users start complaining.

I thought Index wizard would help out, but it hasn't. And I knew that tunning had to be done by hand, but I wanted to give it a shot, after all they (Microsoft Training Experts) tell you that works wonders! Yeah right!

I'll have to check the zillion SQL queries for index usage and execution plan... I just wanted a quicker way.

And Yup, the server is using all four processors... and 2.5 GB of RAM.

Thank you for the input.|||Have you tried using the SQLProfiler to monitor realtime activity (don't forget the filtering) - I'd put as much effort into this as DB tuning @. this stage

you mentioned 14 different Apps & it only takes one badly written one to throw a spanner in the works !

U could try using the query governer to timeout long running Queries & see who screams first - lol.

some Client app developers hit the DB's serially with nasty Client or even Server Side Cursors unnecesarily - does'nt take may of these to make your server sweat.

Also monitor those Locks - if someones hitting the DB with a 60 second exclusive then no amount of Ram's gonna help U.

Basically I'm saying it looks to me like badly written Client apps - unfortunately U may not be able to alter them - but U could at least identify which ones they are & what the actual most intensive processes they're running - then take a fresh look from there.

As always - I could be wrong :-(

GW|||sqlprofiler is a very good start. You can select SQLProfilerTSQL_Duration template and filter out anything higher than 30 or 40 seconds to start with. This way you're not overwhelmed with "zillion" of queries.

At the same time you can specify a TRC file to save the output to. Once you're done collecting data for whatever period of time you choose, - you can open the trace file and your duration will be in ascending order.

Once you pick any offender, - paste it into QA and set IO stats on and execution plan on. In IO stats go after logical reads and scan counts of long tables, and in exec plan after table and index scans.

Hope it'll help.

Sunday, February 12, 2012

concatenation Nullfields in T-SQL

Hi,
I have a list box for Address which shows available addresses for buildings.
I want the list box to concatenate the address and show it.
in Access I used to write :

Select [address] & " " & [city_] & " " & [state] & " " & [bldgzip] AS [Building Address] From tblAdrs

This would show the whole thing even if it had some Null fileds (it wouldn't show if I used + instead of &)

But I don't know why it won't do the same in T-SQL?

Can anyone help?on most servers Null + <any data type> = Null

you can disable this feature or use the ISNULL function.

Select isnull([address],'') + ' '+ isnull([city_],'') + ' '+ isnull([state],'') + ' '+ isnull([bldgzip],'') AS [Building Address] From tblAdrs|||Thanks Paul

Originally posted by Paul Young
on most servers Null + <any data type> = Null

you can disable this feature or use the ISNULL function.

Select isnull([address],'') + ' '+ isnull([city_],'') + ' '+ isnull([state],'') + ' '+ isnull([bldgzip],'') AS [Building Address] From tblAdrs