Sunday, March 25, 2012
create a script for sql server 2005 database maintenance plan
after I manually create maintenance plan using SQL server Maintenence
Plan Wizard with SQL Server Management Studio, is there any way to
create a script for all these setting that I've done?
So that I can just modify the database name and run it on another pc,
the same setting will apply in this pc. Or is there other ways to do
it?
Thanks.
Hi
AFAIK there is no way of doing this for the whole plan, but the SQL for
individual tasks can be views in the View T-SQL button when they are editted.
John
"skyloon" wrote:
> hi,
> after I manually create maintenance plan using SQL server Maintenence
> Plan Wizard with SQL Server Management Studio, is there any way to
> create a script for all these setting that I've done?
> So that I can just modify the database name and run it on another pc,
> the same setting will apply in this pc. Or is there other ways to do
> it?
> Thanks.
>
|||but i can't find the path of my Database Maintenance Plan file that
created under Database engine.
when i connect Integration service, can't find the physical file, how
can i open the plan using SSMS or DTEXEC.EXE?
Tibor Karaszi wrote:[vbcol=seagreen]
> Here's an idea:
> A maint plan is an SSIS package stored in MSDB. You can use SSMS or DTEXEC.EXE to export that
> package to a file. That file is XML. You can now modify that file and distribute it to the target
> machines. (This is from theory, you need to experiment a bit...)
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "skyloon" <skyloon@.gmail.com> wrote in message
> news:1163998620.769408.161720@.j44g2000cwa.googlegr oups.com...
|||I've uploaded a picture for your reference because i can't find any
export function in SSMS. Mind to teach me step by step? Thanks.
http://img.photobucket.com/albums/v202/skyloon/1.jpg
Tibor Karaszi wrote:[vbcol=seagreen]
> You need to export it from msdb to a file first. Use either SSMS (connect object explorer to SSIS)
> or DTUTIL.EXE.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "skyloon" <skyloon@.gmail.com> wrote in message
> news:1164163325.802538.30390@.k70g2000cwa.googlegro ups.com...
|||Hi
If you wish to save a package to a file you would use BIDS and not SSMS. You
may want to check out http://msdn2.microsoft.com/en-us/library/ms137712.aspx
and the package deployment tutorial.
John
"skyloon" wrote:
> I've uploaded a picture for your reference because i can't find any
> export function in SSMS. Mind to teach me step by step? Thanks.
> http://img.photobucket.com/albums/v202/skyloon/1.jpg
>
> Tibor Karaszi wrote:
>
create a script for sql server 2005 database maintenance plan
after I manually create maintenance plan using SQL server Maintenence
Plan Wizard with SQL Server Management Studio, is there any way to
create a script for all these setting that I've done?
So that I can just modify the database name and run it on another pc,
the same setting will apply in this pc. Or is there other ways to do
it?
Thanks.Hi
AFAIK there is no way of doing this for the whole plan, but the SQL for
individual tasks can be views in the View T-SQL button when they are editted
.
John
"skyloon" wrote:
> hi,
> after I manually create maintenance plan using SQL server Maintenence
> Plan Wizard with SQL Server Management Studio, is there any way to
> create a script for all these setting that I've done?
> So that I can just modify the database name and run it on another pc,
> the same setting will apply in this pc. Or is there other ways to do
> it?
> Thanks.
>|||Here's an idea:
A maint plan is an SSIS package stored in MSDB. You can use SSMS or DTEXEC.E
XE to export that
package to a file. That file is XML. You can now modify that file and distri
bute it to the target
machines. (This is from theory, you need to experiment a bit...)
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"skyloon" <skyloon@.gmail.com> wrote in message
news:1163998620.769408.161720@.j44g2000cwa.googlegroups.com...
> hi,
> after I manually create maintenance plan using SQL server Maintenence
> Plan Wizard with SQL Server Management Studio, is there any way to
> create a script for all these setting that I've done?
> So that I can just modify the database name and run it on another pc,
> the same setting will apply in this pc. Or is there other ways to do
> it?
> Thanks.
>|||but i can't find the path of my Database Maintenance Plan file that
created under Database engine.
when i connect Integration service, can't find the physical file, how
can i open the plan using SSMS or DTEXEC.EXE?
Tibor Karaszi wrote:[vbcol=seagreen]
> Here's an idea:
> A maint plan is an SSIS package stored in MSDB. You can use SSMS or DTEXEC
.EXE to export that
> package to a file. That file is XML. You can now modify that file and dist
ribute it to the target
> machines. (This is from theory, you need to experiment a bit...)
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "skyloon" <skyloon@.gmail.com> wrote in message
> news:1163998620.769408.161720@.j44g2000cwa.googlegroups.com...|||You need to export it from msdb to a file first. Use either SSMS (connect ob
ject explorer to SSIS)
or DTUTIL.EXE.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"skyloon" <skyloon@.gmail.com> wrote in message
news:1164163325.802538.30390@.k70g2000cwa.googlegroups.com...
> but i can't find the path of my Database Maintenance Plan file that
> created under Database engine.
> when i connect Integration service, can't find the physical file, how
> can i open the plan using SSMS or DTEXEC.EXE?
> Tibor Karaszi wrote:
>|||I've uploaded a picture for your reference because i can't find any
export function in SSMS. Mind to teach me step by step? Thanks.
http://img.photobucket.com/albums/v202/skyloon/1.jpg
Tibor Karaszi wrote:[vbcol=seagreen]
> You need to export it from msdb to a file first. Use either SSMS (connect
object explorer to SSIS)
> or DTUTIL.EXE.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "skyloon" <skyloon@.gmail.com> wrote in message
> news:1164163325.802538.30390@.k70g2000cwa.googlegroups.com...|||Hi
If you wish to save a package to a file you would use BIDS and not SSMS. You
may want to check out http://msdn2.microsoft.com/en-us/library/ms137712.aspx
and the package deployment tutorial.
John
"skyloon" wrote:
> I've uploaded a picture for your reference because i can't find any
> export function in SSMS. Mind to teach me step by step? Thanks.
> http://img.photobucket.com/albums/v202/skyloon/1.jpg
>
> Tibor Karaszi wrote:
>|||You connected Object Explorer to a SQL Server instance. You need to connect
Object Explorer to SSIS.
In Object Explorer, select the Connect button (top of Object Explorer), sele
ct Integration Services,
specify the server name (no instance name, you can only have one SSIS servic
e). Now, expand the
Stored Packages folder, MSDB, Maintenance Plans. Right-click your package an
d select Export.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"skyloon" <skyloon@.gmail.com> wrote in message
news:1164243388.835755.301510@.j44g2000cwa.googlegroups.com...
> I've uploaded a picture for your reference because i can't find any
> export function in SSMS. Mind to teach me step by step? Thanks.
> http://img.photobucket.com/albums/v202/skyloon/1.jpg
>
> Tibor Karaszi wrote:
>
create a script for sql server 2005 database maintenance plan
after I manually create maintenance plan using SQL server Maintenence
Plan Wizard with SQL Server Management Studio, is there any way to
create a script for all these setting that I've done?
So that I can just modify the database name and run it on another pc,
the same setting will apply in this pc. Or is there other ways to do
it?
Thanks.Hi
AFAIK there is no way of doing this for the whole plan, but the SQL for
individual tasks can be views in the View T-SQL button when they are editted.
John
"skyloon" wrote:
> hi,
> after I manually create maintenance plan using SQL server Maintenence
> Plan Wizard with SQL Server Management Studio, is there any way to
> create a script for all these setting that I've done?
> So that I can just modify the database name and run it on another pc,
> the same setting will apply in this pc. Or is there other ways to do
> it?
> Thanks.
>|||Here's an idea:
A maint plan is an SSIS package stored in MSDB. You can use SSMS or DTEXEC.EXE to export that
package to a file. That file is XML. You can now modify that file and distribute it to the target
machines. (This is from theory, you need to experiment a bit...)
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"skyloon" <skyloon@.gmail.com> wrote in message
news:1163998620.769408.161720@.j44g2000cwa.googlegroups.com...
> hi,
> after I manually create maintenance plan using SQL server Maintenence
> Plan Wizard with SQL Server Management Studio, is there any way to
> create a script for all these setting that I've done?
> So that I can just modify the database name and run it on another pc,
> the same setting will apply in this pc. Or is there other ways to do
> it?
> Thanks.
>|||but i can't find the path of my Database Maintenance Plan file that
created under Database engine.
when i connect Integration service, can't find the physical file, how
can i open the plan using SSMS or DTEXEC.EXE?
Tibor Karaszi wrote:
> Here's an idea:
> A maint plan is an SSIS package stored in MSDB. You can use SSMS or DTEXEC.EXE to export that
> package to a file. That file is XML. You can now modify that file and distribute it to the target
> machines. (This is from theory, you need to experiment a bit...)
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "skyloon" <skyloon@.gmail.com> wrote in message
> news:1163998620.769408.161720@.j44g2000cwa.googlegroups.com...
> > hi,
> > after I manually create maintenance plan using SQL server Maintenence
> > Plan Wizard with SQL Server Management Studio, is there any way to
> > create a script for all these setting that I've done?
> > So that I can just modify the database name and run it on another pc,
> > the same setting will apply in this pc. Or is there other ways to do
> > it?
> > Thanks.
> >|||You need to export it from msdb to a file first. Use either SSMS (connect object explorer to SSIS)
or DTUTIL.EXE.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"skyloon" <skyloon@.gmail.com> wrote in message
news:1164163325.802538.30390@.k70g2000cwa.googlegroups.com...
> but i can't find the path of my Database Maintenance Plan file that
> created under Database engine.
> when i connect Integration service, can't find the physical file, how
> can i open the plan using SSMS or DTEXEC.EXE?
> Tibor Karaszi wrote:
>> Here's an idea:
>> A maint plan is an SSIS package stored in MSDB. You can use SSMS or DTEXEC.EXE to export that
>> package to a file. That file is XML. You can now modify that file and distribute it to the target
>> machines. (This is from theory, you need to experiment a bit...)
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>>
>> "skyloon" <skyloon@.gmail.com> wrote in message
>> news:1163998620.769408.161720@.j44g2000cwa.googlegroups.com...
>> > hi,
>> > after I manually create maintenance plan using SQL server Maintenence
>> > Plan Wizard with SQL Server Management Studio, is there any way to
>> > create a script for all these setting that I've done?
>> > So that I can just modify the database name and run it on another pc,
>> > the same setting will apply in this pc. Or is there other ways to do
>> > it?
>> > Thanks.
>> >
>|||I've uploaded a picture for your reference because i can't find any
export function in SSMS. Mind to teach me step by step? Thanks.
http://img.photobucket.com/albums/v202/skyloon/1.jpg
Tibor Karaszi wrote:
> You need to export it from msdb to a file first. Use either SSMS (connect object explorer to SSIS)
> or DTUTIL.EXE.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "skyloon" <skyloon@.gmail.com> wrote in message
> news:1164163325.802538.30390@.k70g2000cwa.googlegroups.com...
> > but i can't find the path of my Database Maintenance Plan file that
> > created under Database engine.
> > when i connect Integration service, can't find the physical file, how
> > can i open the plan using SSMS or DTEXEC.EXE?
> >
> > Tibor Karaszi wrote:
> >> Here's an idea:
> >>
> >> A maint plan is an SSIS package stored in MSDB. You can use SSMS or DTEXEC.EXE to export that
> >> package to a file. That file is XML. You can now modify that file and distribute it to the target
> >> machines. (This is from theory, you need to experiment a bit...)
> >>
> >> --
> >> Tibor Karaszi, SQL Server MVP
> >> http://www.karaszi.com/sqlserver/default.asp
> >> http://www.solidqualitylearning.com/
> >>
> >>
> >> "skyloon" <skyloon@.gmail.com> wrote in message
> >> news:1163998620.769408.161720@.j44g2000cwa.googlegroups.com...
> >> > hi,
> >> > after I manually create maintenance plan using SQL server Maintenence
> >> > Plan Wizard with SQL Server Management Studio, is there any way to
> >> > create a script for all these setting that I've done?
> >> > So that I can just modify the database name and run it on another pc,
> >> > the same setting will apply in this pc. Or is there other ways to do
> >> > it?
> >> > Thanks.
> >> >
> >|||Hi
If you wish to save a package to a file you would use BIDS and not SSMS. You
may want to check out http://msdn2.microsoft.com/en-us/library/ms137712.aspx
and the package deployment tutorial.
John
"skyloon" wrote:
> I've uploaded a picture for your reference because i can't find any
> export function in SSMS. Mind to teach me step by step? Thanks.
> http://img.photobucket.com/albums/v202/skyloon/1.jpg
>
> Tibor Karaszi wrote:
> > You need to export it from msdb to a file first. Use either SSMS (connect object explorer to SSIS)
> > or DTUTIL.EXE.
> >
> > --
> > Tibor Karaszi, SQL Server MVP
> > http://www.karaszi.com/sqlserver/default.asp
> > http://www.solidqualitylearning.com/
> >
> >
> > "skyloon" <skyloon@.gmail.com> wrote in message
> > news:1164163325.802538.30390@.k70g2000cwa.googlegroups.com...
> > > but i can't find the path of my Database Maintenance Plan file that
> > > created under Database engine.
> > > when i connect Integration service, can't find the physical file, how
> > > can i open the plan using SSMS or DTEXEC.EXE?
> > >
> > > Tibor Karaszi wrote:
> > >> Here's an idea:
> > >>
> > >> A maint plan is an SSIS package stored in MSDB. You can use SSMS or DTEXEC.EXE to export that
> > >> package to a file. That file is XML. You can now modify that file and distribute it to the target
> > >> machines. (This is from theory, you need to experiment a bit...)
> > >>
> > >> --
> > >> Tibor Karaszi, SQL Server MVP
> > >> http://www.karaszi.com/sqlserver/default.asp
> > >> http://www.solidqualitylearning.com/
> > >>
> > >>
> > >> "skyloon" <skyloon@.gmail.com> wrote in message
> > >> news:1163998620.769408.161720@.j44g2000cwa.googlegroups.com...
> > >> > hi,
> > >> > after I manually create maintenance plan using SQL server Maintenence
> > >> > Plan Wizard with SQL Server Management Studio, is there any way to
> > >> > create a script for all these setting that I've done?
> > >> > So that I can just modify the database name and run it on another pc,
> > >> > the same setting will apply in this pc. Or is there other ways to do
> > >> > it?
> > >> > Thanks.
> > >> >
> > >
>|||You connected Object Explorer to a SQL Server instance. You need to connect Object Explorer to SSIS.
In Object Explorer, select the Connect button (top of Object Explorer), select Integration Services,
specify the server name (no instance name, you can only have one SSIS service). Now, expand the
Stored Packages folder, MSDB, Maintenance Plans. Right-click your package and select Export.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"skyloon" <skyloon@.gmail.com> wrote in message
news:1164243388.835755.301510@.j44g2000cwa.googlegroups.com...
> I've uploaded a picture for your reference because i can't find any
> export function in SSMS. Mind to teach me step by step? Thanks.
> http://img.photobucket.com/albums/v202/skyloon/1.jpg
>
> Tibor Karaszi wrote:
>> You need to export it from msdb to a file first. Use either SSMS (connect object explorer to
>> SSIS)
>> or DTUTIL.EXE.
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>>
>> "skyloon" <skyloon@.gmail.com> wrote in message
>> news:1164163325.802538.30390@.k70g2000cwa.googlegroups.com...
>> > but i can't find the path of my Database Maintenance Plan file that
>> > created under Database engine.
>> > when i connect Integration service, can't find the physical file, how
>> > can i open the plan using SSMS or DTEXEC.EXE?
>> >
>> > Tibor Karaszi wrote:
>> >> Here's an idea:
>> >>
>> >> A maint plan is an SSIS package stored in MSDB. You can use SSMS or DTEXEC.EXE to export that
>> >> package to a file. That file is XML. You can now modify that file and distribute it to the
>> >> target
>> >> machines. (This is from theory, you need to experiment a bit...)
>> >>
>> >> --
>> >> Tibor Karaszi, SQL Server MVP
>> >> http://www.karaszi.com/sqlserver/default.asp
>> >> http://www.solidqualitylearning.com/
>> >>
>> >>
>> >> "skyloon" <skyloon@.gmail.com> wrote in message
>> >> news:1163998620.769408.161720@.j44g2000cwa.googlegroups.com...
>> >> > hi,
>> >> > after I manually create maintenance plan using SQL server Maintenence
>> >> > Plan Wizard with SQL Server Management Studio, is there any way to
>> >> > create a script for all these setting that I've done?
>> >> > So that I can just modify the database name and run it on another pc,
>> >> > the same setting will apply in this pc. Or is there other ways to do
>> >> > it?
>> >> > Thanks.
>> >> >
>> >
>
Create a publication in SQL Server 2005 Express
is it possible to create a publication with SQL Server 2005 Express. I can′t seem to find it in Microsoft SQL Server Management Studio Express.
Do i have to install the full version? :(
Isn′t there any other option?
Thanks
SP
SQL Express can't serve as publisher or distributor for all types of replication. For more considerations for replication on SQL express. checkout this topic: http://msdn2.microsoft.com/en-us/library/ms165686.aspx in BOL.
You will need workgroup edition or above, although the workgroup has limitations on the number of subscriptions. For full detail, take a look at "Features Supported by the Editions of SQL Server 2005" (http://msdn2.microsoft.com/en-us/library/ms143761.aspx)
Peng
|||No, it's not possible to create a publication in the Express edition. For express edition, your server can only use as subsriber in replication. You will need to use a regular SQL server as your publisher and distributor.
http://msdn2.microsoft.com/en-us/library/ms165616.aspx
Regards,
Gary
|||I′m installing the complete SQL Server 2005 and i have the following options:sql server database services
Thursday, March 8, 2012
CPU Usage(%), Logical IO Performed (%) Usage for Adhoc Queries is 90%
Hello, When I am seeing SQL Server 2005 Management studio Server Dashboard> I am seeing my(USERS) databases and msdb database usage is very small % of in CPU Usage(%), Logical IO Performed (%) Usage pie chart.
90% of Total cpu usage is showing for Adhoc Queries. what excatly this means in Dashboard? if application uses more than it would have shown in Database level or not?
sicerely this dashboard is good, if any one is watching daily, please advice their experiences here.
Thanks in advance. Hail SQL Server!
This means that of all the CPU and I/O performed 90% is coming from Adhoc Queries, it does not mean 90% CPU usage.
WesleyB
Visit my SQL Server weblog @. http://dis4ea.blogspot.com
CPU Usage Management and SQL
which is being maxed out and causing my sites to run
slow. I fear this may be related to me not properly
closing connections (I am lazy) and me just hosting too
many databases on one server. Regardless, I need insight
on how to manage this and reset CPU Usage from a SQL
perspective. Also, is there a way to see all connections
opened and individually close them? Will that help me
you think? Thanks in advance.if you execute
sp_who
or
sp_who2
from Query Analyzer, you will be shown a listing of the open =connections.
Generally, open connections would not cause CPU usage, but they do use =memory. If there are lots of open (unused) connections then your memory =usage might be higher than it needs to be. ADO should be using =connection pooling, so I would not expect that you lots of extra =connections, but I could be wrong.
The best tool to see what is going on within the database server is =Profiler (within the SQL Server program group). It will show you what =sql commands are being sent to the database.
If you can identify which stored procedures/select statements cause =problems (take a long time to run, use gobs of CPU) you might be able to =re-write them or add indexes so that the system does not have to work as =hard to retrieve the information that the application is asking for.
-- Keith, SQL Server MVP
"ASP Dev" <dmicheli@.cmiti.com> wrote in message =news:030201c34b03$bead2830$a301280a@.phx.gbl...
> Right now SQL Server accounts for 80% of my CPU Usage > which is being maxed out and causing my sites to run > slow. I fear this may be related to me not properly > closing connections (I am lazy) and me just hosting too > many databases on one server. Regardless, I need insight > on how to manage this and reset CPU Usage from a SQL > perspective. Also, is there a way to see all connections > opened and individually close them? Will that help me > you think? Thanks in advance.|||Thank You. I appreciate your help.
>--Original Message--
>if you execute
>sp_who
>or
>sp_who2
>from Query Analyzer, you will be shown a listing of the
open connections.
>Generally, open connections would not cause CPU usage,
but they do use memory. If there are lots of open
(unused) connections then your memory usage might be
higher than it needs to be. ADO should be using
connection pooling, so I would not expect that you lots
of extra connections, but I could be wrong.
>The best tool to see what is going on within the
database server is Profiler (within the SQL Server
program group). It will show you what sql commands are
being sent to the database.
>If you can identify which stored procedures/select
statements cause problems (take a long time to run, use
gobs of CPU) you might be able to re-write them or add
indexes so that the system does not have to work as hard
to retrieve the information that the application is
asking for.
>--
>Keith, SQL Server MVP
>"ASP Dev" <dmicheli@.cmiti.com> wrote in message
news:030201c34b03$bead2830$a301280a@.phx.gbl...
>> Right now SQL Server accounts for 80% of my CPU Usage
>> which is being maxed out and causing my sites to run
>> slow. I fear this may be related to me not properly
>> closing connections (I am lazy) and me just hosting
too
>> many databases on one server. Regardless, I need
insight
>> on how to manage this and reset CPU Usage from a SQL
>> perspective. Also, is there a way to see all
connections
>> opened and individually close them? Will that help me
>> you think? Thanks in advance.
>.
>|||we had a history of CPU usage here. At peak time the usage would stay up to
100% staying there for 10, 15 minutes. Last few weeks it stayed above 95%
for couple hrs. The problem was poor SQL statements and the management
reports. All queries were pure SELECT or UPDATE, no stored procedures used.
During business hrs the big bosses just wanted to see how well the business
so far for the day so they just clicked whenever they want to produce an
up-to-date online report!!!. I've warned the bosses and developers about
this but it was kind of they prefered to upgrade h/w than rewriting the
codes and kept running reports ... whenever they want. After a meeting with
the big bosses they agreed it was a big problem and promised not to run
report during peak hrs. And just next day we saw them running report like
crazy again! Until last month the web site got timed-out then they took it
seriously. Spending 50-100K for both s/w and h/w wasn't an easy thing so
the developres rewrote the main interface for the site using pure stored
procedures. They also locked out the report tool, kept it from runinng b/w
10am and 2pm. Result: it rocked. Using Insight Manager I see the avg. CPU
usage is b/w 10 and 15%. Everyone is happy with it.:-).
"ASP Dev" <dmicheli@.cmiti.com> wrote in message
news:030201c34b03$bead2830$a301280a@.phx.gbl...
> Right now SQL Server accounts for 80% of my CPU Usage
> which is being maxed out and causing my sites to run
> slow. I fear this may be related to me not properly
> closing connections (I am lazy) and me just hosting too
> many databases on one server. Regardless, I need insight
> on how to manage this and reset CPU Usage from a SQL
> perspective. Also, is there a way to see all connections
> opened and individually close them? Will that help me
> you think? Thanks in advance.|||On Tue, 15 Jul 2003 14:19:06 -0700, "Flicker"
<hthan@.superioraccess.com> wrote:
>They also locked out the report tool, kept it from runinng b/w
>10am and 2pm. Result: it rocked.
How about you replicate the data out to a mart/warehouse so they can
click all they want?
J.|||there is no need for the report to run every few minutes. The chairman does
it; the VPs do it; the CEO does it. This is kind of more a habit than a
business need, just like you are checking stocks every hour. After we
locked them out, they do other things to kill time.:) Hey, they are also
the OWNERS. So long ...
"JXStern" <JXSternChangeX2R@.gte.net> wrote in message
news:6fuahv4s12omn7l7k3c1jfp3ivs2up3h8h@.4ax.com...
> On Tue, 15 Jul 2003 14:19:06 -0700, "Flicker"
> <hthan@.superioraccess.com> wrote:
> >They also locked out the report tool, kept it from runinng b/w
> >10am and 2pm. Result: it rocked.
> How about you replicate the data out to a mart/warehouse so they can
> click all they want?
> J.
>
Wednesday, March 7, 2012
CPU speed 1.9 and 2.6
suffice and I dont have to go to management and make them decomission these
servers and instead buy a 2.6 or greater speed CPU.
Has anyone benchmarked a 1.9 and 2.6Ghz procs. I am currently not pressured
on CPU, so if I move my processing say from a 2.6 proc to a 1.9 proc speed
server, will my performance degrade ?
ThanksIt's your disk speed that measures performance! CPU is always your last
bottleneck in a SQL Server. The first two are RAM and Disk. Why does
everybody go out and buy shiny new processors to make their SQL Server
faster?
After you spend all your money, you discover there is no money left for a
screaming fast disk subsystem.
Ask your stump-stupid management to buy a screaming fast disk subsystem with
many raid controllers. (remember PCI cards maxes at 133MB/sec)
"Hassan" <hassan@.hotmail.com> wrote in message
news:%23dyxV9l8FHA.3544@.TK2MSFTNGP09.phx.gbl...
> Sometimes I'm kinda struggling to prove that a 4 way 1.9GHz procs would
> suffice and I dont have to go to management and make them decomission
> these servers and instead buy a 2.6 or greater speed CPU.
> Has anyone benchmarked a 1.9 and 2.6Ghz procs. I am currently not
> pressured on CPU, so if I move my processing say from a 2.6 proc to a 1.9
> proc speed server, will my performance degrade ?
> Thanks
>|||LOL! LOL!
Bud, you nailed the point!
this is what I wanted to post to newsgroups and somehow got it sent to
email.
Some people just don't get it. I/O, RAM, CPU! That is the order you spend
your money, unless one can prove it otherwise.
Farmer.
-- Original Message --
From: "Hotmail" <>
To: "Hassan" <>
Sent: Sunday, November 27, 2005 10:28 AM
Subject: Re: CPU speed 1.9 and 2.6
> Hi Hassan,
> there one good article that came out lately that gives good explanation of
> how CPU speed, their level 2 and level 3 caches influence SQL performance.
> It's called "Bare-Metal Tuning"
> at
> http://www.windowsitpro.com/SQLServer/Article/ArticleID/46492/SQLServer_46492.html
> It is for subscribers, therefore I can't post its contents here. You may
> want to subscribe to this magazine, it's very good.
> You don't provide enough info to make much conclusions about CPUs that you
> have, like their models, types, cache sizes and their quantities
> (hypothetical for your new server). The rest of the server construction is
> also important, like bus speeds, RAID types, raid controllers and on and
> on. All being equal, you will see lower performance but that is only if
> your SQL is CPU bound, i.e. the bottleneck is CPU. I would doubt that is
> the case as your I/O subsystem is usually is the first bottleneck, then
> memory then CPU. You have to monitor your system to know these factors.
> I can build a server with 4 x 1.9 Ghz cpus that will leave stock 2.6 Ghz
> server eating dust behind, (with smart RAID and RAID cache, several
> independent raid controllers and lots of main memory). It all depends a
> lot on what else is in the server.
> I would suggest you don't waste your company money; they can be spent with
> better ROI and use this 4 way server until you have performance statistics
> to prove you need more powerful CPUs and better server. I find that people
> tend to overbuy on unfounded theoretical performance fears just like many
> people overbuy insurance policies with 0 deductibles.
>
> Thanks
> Farmer.
"Bud Y. Zer" <bud@.Gibralter.Bra> wrote in message
news:ecwog%23R9FHA.252@.TK2MSFTNGP15.phx.gbl...
> It's your disk speed that measures performance! CPU is always your last
> bottleneck in a SQL Server. The first two are RAM and Disk. Why does
> everybody go out and buy shiny new processors to make their SQL Server
> faster?
> After you spend all your money, you discover there is no money left for a
> screaming fast disk subsystem.
> Ask your stump-stupid management to buy a screaming fast disk subsystem
> with many raid controllers. (remember PCI cards maxes at 133MB/sec)
>
> "Hassan" <hassan@.hotmail.com> wrote in message
> news:%23dyxV9l8FHA.3544@.TK2MSFTNGP09.phx.gbl...
>> Sometimes I'm kinda struggling to prove that a 4 way 1.9GHz procs would
>> suffice and I dont have to go to management and make them decomission
>> these servers and instead buy a 2.6 or greater speed CPU.
>> Has anyone benchmarked a 1.9 and 2.6Ghz procs. I am currently not
>> pressured on CPU, so if I move my processing say from a 2.6 proc to a 1.9
>> proc speed server, will my performance degrade ?
>> Thanks
>|||So thats nice to know.. So what does one need to ask ? So if i say give me
faster IO, what does that mean ? What do we get as standards and what should
we be getting ?
Please let me know so I know exactly what to ask for
"Farmer" <someone@.somewhere.com> wrote in message
news:%238KUl0t9FHA.4048@.TK2MSFTNGP10.phx.gbl...
> LOL! LOL!
> Bud, you nailed the point!
> this is what I wanted to post to newsgroups and somehow got it sent to
> email.
> Some people just don't get it. I/O, RAM, CPU! That is the order you spend
> your money, unless one can prove it otherwise.
> Farmer.
> -- Original Message --
> From: "Hotmail" <>
> To: "Hassan" <>
> Sent: Sunday, November 27, 2005 10:28 AM
> Subject: Re: CPU speed 1.9 and 2.6
>
>> Hi Hassan,
>> there one good article that came out lately that gives good explanation
>> of how CPU speed, their level 2 and level 3 caches influence SQL
>> performance. It's called "Bare-Metal Tuning"
>> at
>> http://www.windowsitpro.com/SQLServer/Article/ArticleID/46492/SQLServer_46492.html
>> It is for subscribers, therefore I can't post its contents here. You may
>> want to subscribe to this magazine, it's very good.
>> You don't provide enough info to make much conclusions about CPUs that
>> you have, like their models, types, cache sizes and their quantities
>> (hypothetical for your new server). The rest of the server construction
>> is also important, like bus speeds, RAID types, raid controllers and on
>> and on. All being equal, you will see lower performance but that is only
>> if your SQL is CPU bound, i.e. the bottleneck is CPU. I would doubt that
>> is the case as your I/O subsystem is usually is the first bottleneck,
>> then memory then CPU. You have to monitor your system to know these
>> factors.
>> I can build a server with 4 x 1.9 Ghz cpus that will leave stock 2.6 Ghz
>> server eating dust behind, (with smart RAID and RAID cache, several
>> independent raid controllers and lots of main memory). It all depends a
>> lot on what else is in the server.
>> I would suggest you don't waste your company money; they can be spent
>> with better ROI and use this 4 way server until you have performance
>> statistics to prove you need more powerful CPUs and better server. I find
>> that people tend to overbuy on unfounded theoretical performance fears
>> just like many people overbuy insurance policies with 0 deductibles.
>>
>> Thanks
>> Farmer.
>
>
> "Bud Y. Zer" <bud@.Gibralter.Bra> wrote in message
> news:ecwog%23R9FHA.252@.TK2MSFTNGP15.phx.gbl...
>> It's your disk speed that measures performance! CPU is always your last
>> bottleneck in a SQL Server. The first two are RAM and Disk. Why does
>> everybody go out and buy shiny new processors to make their SQL Server
>> faster?
>> After you spend all your money, you discover there is no money left for a
>> screaming fast disk subsystem.
>> Ask your stump-stupid management to buy a screaming fast disk subsystem
>> with many raid controllers. (remember PCI cards maxes at 133MB/sec)
>>
>> "Hassan" <hassan@.hotmail.com> wrote in message
>> news:%23dyxV9l8FHA.3544@.TK2MSFTNGP09.phx.gbl...
>> Sometimes I'm kinda struggling to prove that a 4 way 1.9GHz procs would
>> suffice and I dont have to go to management and make them decomission
>> these servers and instead buy a 2.6 or greater speed CPU.
>> Has anyone benchmarked a 1.9 and 2.6Ghz procs. I am currently not
>> pressured on CPU, so if I move my processing say from a 2.6 proc to a
>> 1.9 proc speed server, will my performance degrade ?
>> Thanks
>>
>|||You can start here.
http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/sqlops6.mspx
"Hassan" <hassan@.hotmail.com> wrote in message
news:e2aIw3Q%23FHA.3036@.TK2MSFTNGP10.phx.gbl...
> So thats nice to know.. So what does one need to ask ? So if i say give me
> faster IO, what does that mean ? What do we get as standards and what
> should we be getting ?
> Please let me know so I know exactly what to ask for
> "Farmer" <someone@.somewhere.com> wrote in message
> news:%238KUl0t9FHA.4048@.TK2MSFTNGP10.phx.gbl...
>> LOL! LOL!
>> Bud, you nailed the point!
>> this is what I wanted to post to newsgroups and somehow got it sent to
>> email.
>> Some people just don't get it. I/O, RAM, CPU! That is the order you
>> spend your money, unless one can prove it otherwise.
>> Farmer.
>> -- Original Message --
>> From: "Hotmail" <>
>> To: "Hassan" <>
>> Sent: Sunday, November 27, 2005 10:28 AM
>> Subject: Re: CPU speed 1.9 and 2.6
>>
>> Hi Hassan,
>> there one good article that came out lately that gives good explanation
>> of how CPU speed, their level 2 and level 3 caches influence SQL
>> performance. It's called "Bare-Metal Tuning"
>> at
>> http://www.windowsitpro.com/SQLServer/Article/ArticleID/46492/SQLServer_46492.html
>> It is for subscribers, therefore I can't post its contents here. You may
>> want to subscribe to this magazine, it's very good.
>> You don't provide enough info to make much conclusions about CPUs that
>> you have, like their models, types, cache sizes and their quantities
>> (hypothetical for your new server). The rest of the server construction
>> is also important, like bus speeds, RAID types, raid controllers and on
>> and on. All being equal, you will see lower performance but that is only
>> if your SQL is CPU bound, i.e. the bottleneck is CPU. I would doubt that
>> is the case as your I/O subsystem is usually is the first bottleneck,
>> then memory then CPU. You have to monitor your system to know these
>> factors.
>> I can build a server with 4 x 1.9 Ghz cpus that will leave stock 2.6 Ghz
>> server eating dust behind, (with smart RAID and RAID cache, several
>> independent raid controllers and lots of main memory). It all depends a
>> lot on what else is in the server.
>> I would suggest you don't waste your company money; they can be spent
>> with better ROI and use this 4 way server until you have performance
>> statistics to prove you need more powerful CPUs and better server. I
>> find that people tend to overbuy on unfounded theoretical performance
>> fears just like many people overbuy insurance policies with 0
>> deductibles.
>>
>> Thanks
>> Farmer.
>>
>>
>> "Bud Y. Zer" <bud@.Gibralter.Bra> wrote in message
>> news:ecwog%23R9FHA.252@.TK2MSFTNGP15.phx.gbl...
>> It's your disk speed that measures performance! CPU is always your last
>> bottleneck in a SQL Server. The first two are RAM and Disk. Why does
>> everybody go out and buy shiny new processors to make their SQL Server
>> faster?
>> After you spend all your money, you discover there is no money left for
>> a screaming fast disk subsystem.
>> Ask your stump-stupid management to buy a screaming fast disk subsystem
>> with many raid controllers. (remember PCI cards maxes at 133MB/sec)
>>
>> "Hassan" <hassan@.hotmail.com> wrote in message
>> news:%23dyxV9l8FHA.3544@.TK2MSFTNGP09.phx.gbl...
>> Sometimes I'm kinda struggling to prove that a 4 way 1.9GHz procs would
>> suffice and I dont have to go to management and make them decomission
>> these servers and instead buy a 2.6 or greater speed CPU.
>> Has anyone benchmarked a 1.9 and 2.6Ghz procs. I am currently not
>> pressured on CPU, so if I move my processing say from a 2.6 proc to a
>> 1.9 proc speed server, will my performance degrade ?
>> Thanks
>>
>>
>
CPU speed 1.9 and 2.6
suffice and I dont have to go to management and make them decomission these
servers and instead buy a 2.6 or greater speed CPU.
Has anyone benchmarked a 1.9 and 2.6Ghz procs. I am currently not pressured
on CPU, so if I move my processing say from a 2.6 proc to a 1.9 proc speed
server, will my performance degrade ?
Thanks
It's your disk speed that measures performance! CPU is always your last
bottleneck in a SQL Server. The first two are RAM and Disk. Why does
everybody go out and buy shiny new processors to make their SQL Server
faster?
After you spend all your money, you discover there is no money left for a
screaming fast disk subsystem.
Ask your stump-stupid management to buy a screaming fast disk subsystem with
many raid controllers. (remember PCI cards maxes at 133MB/sec)
"Hassan" <hassan@.hotmail.com> wrote in message
news:%23dyxV9l8FHA.3544@.TK2MSFTNGP09.phx.gbl...
> Sometimes I'm kinda struggling to prove that a 4 way 1.9GHz procs would
> suffice and I dont have to go to management and make them decomission
> these servers and instead buy a 2.6 or greater speed CPU.
> Has anyone benchmarked a 1.9 and 2.6Ghz procs. I am currently not
> pressured on CPU, so if I move my processing say from a 2.6 proc to a 1.9
> proc speed server, will my performance degrade ?
> Thanks
>
|||LOL! LOL!
Bud, you nailed the point!
this is what I wanted to post to newsgroups and somehow got it sent to
email.
Some people just don't get it. I/O, RAM, CPU! That is the order you spend
your money, unless one can prove it otherwise.
Farmer.
-- Original Message --
From: "Hotmail" <>
To: "Hassan" <>
Sent: Sunday, November 27, 2005 10:28 AM
Subject: Re: CPU speed 1.9 and 2.6
> Hi Hassan,
> there one good article that came out lately that gives good explanation of
> how CPU speed, their level 2 and level 3 caches influence SQL performance.
> It's called "Bare-Metal Tuning"
> at
> http://www.windowsitpro.com/SQLServe...ver_46492.html
> It is for subscribers, therefore I can't post its contents here. You may
> want to subscribe to this magazine, it's very good.
> You don't provide enough info to make much conclusions about CPUs that you
> have, like their models, types, cache sizes and their quantities
> (hypothetical for your new server). The rest of the server construction is
> also important, like bus speeds, RAID types, raid controllers and on and
> on. All being equal, you will see lower performance but that is only if
> your SQL is CPU bound, i.e. the bottleneck is CPU. I would doubt that is
> the case as your I/O subsystem is usually is the first bottleneck, then
> memory then CPU. You have to monitor your system to know these factors.
> I can build a server with 4 x 1.9 Ghz cpus that will leave stock 2.6 Ghz
> server eating dust behind, (with smart RAID and RAID cache, several
> independent raid controllers and lots of main memory). It all depends a
> lot on what else is in the server.
> I would suggest you don't waste your company money; they can be spent with
> better ROI and use this 4 way server until you have performance statistics
> to prove you need more powerful CPUs and better server. I find that people
> tend to overbuy on unfounded theoretical performance fears just like many
> people overbuy insurance policies with 0 deductibles.
>
> Thanks
> Farmer.
"Bud Y. Zer" <bud@.Gibralter.Bra> wrote in message
news:ecwog%23R9FHA.252@.TK2MSFTNGP15.phx.gbl...
> It's your disk speed that measures performance! CPU is always your last
> bottleneck in a SQL Server. The first two are RAM and Disk. Why does
> everybody go out and buy shiny new processors to make their SQL Server
> faster?
> After you spend all your money, you discover there is no money left for a
> screaming fast disk subsystem.
> Ask your stump-stupid management to buy a screaming fast disk subsystem
> with many raid controllers. (remember PCI cards maxes at 133MB/sec)
>
> "Hassan" <hassan@.hotmail.com> wrote in message
> news:%23dyxV9l8FHA.3544@.TK2MSFTNGP09.phx.gbl...
>
|||So thats nice to know.. So what does one need to ask ? So if i say give me
faster IO, what does that mean ? What do we get as standards and what should
we be getting ?
Please let me know so I know exactly what to ask for
"Farmer" <someone@.somewhere.com> wrote in message
news:%238KUl0t9FHA.4048@.TK2MSFTNGP10.phx.gbl...
> LOL! LOL!
> Bud, you nailed the point!
> this is what I wanted to post to newsgroups and somehow got it sent to
> email.
> Some people just don't get it. I/O, RAM, CPU! That is the order you spend
> your money, unless one can prove it otherwise.
> Farmer.
> -- Original Message --
> From: "Hotmail" <>
> To: "Hassan" <>
> Sent: Sunday, November 27, 2005 10:28 AM
> Subject: Re: CPU speed 1.9 and 2.6
>
>
>
> "Bud Y. Zer" <bud@.Gibralter.Bra> wrote in message
> news:ecwog%23R9FHA.252@.TK2MSFTNGP15.phx.gbl...
>
|||You can start here.
http://www.microsoft.com/technet/pro...n/sqlops6.mspx
"Hassan" <hassan@.hotmail.com> wrote in message
news:e2aIw3Q%23FHA.3036@.TK2MSFTNGP10.phx.gbl...
> So thats nice to know.. So what does one need to ask ? So if i say give me
> faster IO, what does that mean ? What do we get as standards and what
> should we be getting ?
> Please let me know so I know exactly what to ask for
> "Farmer" <someone@.somewhere.com> wrote in message
> news:%238KUl0t9FHA.4048@.TK2MSFTNGP10.phx.gbl...
>
CPU speed 1.9 and 2.6
suffice and I dont have to go to management and make them decomission these
servers and instead buy a 2.6 or greater speed CPU.
Has anyone benchmarked a 1.9 and 2.6Ghz procs. I am currently not pressured
on CPU, so if I move my processing say from a 2.6 proc to a 1.9 proc speed
server, will my performance degrade ?
ThanksIt's your disk speed that measures performance! CPU is always your last
bottleneck in a SQL Server. The first two are RAM and Disk. Why does
everybody go out and buy shiny new processors to make their SQL Server
faster?
After you spend all your money, you discover there is no money left for a
screaming fast disk subsystem.
Ask your stump-stupid management to buy a screaming fast disk subsystem with
many raid controllers. (remember PCI cards maxes at 133MB/sec)
"Hassan" <hassan@.hotmail.com> wrote in message
news:%23dyxV9l8FHA.3544@.TK2MSFTNGP09.phx.gbl...
> Sometimes I'm kinda struggling to prove that a 4 way 1.9GHz procs would
> suffice and I dont have to go to management and make them decomission
> these servers and instead buy a 2.6 or greater speed CPU.
> Has anyone benchmarked a 1.9 and 2.6Ghz procs. I am currently not
> pressured on CPU, so if I move my processing say from a 2.6 proc to a 1.9
> proc speed server, will my performance degrade ?
> Thanks
>|||LOL! LOL!
Bud, you nailed the point!
this is what I wanted to post to newsgroups and somehow got it sent to
email.
Some people just don't get it. I/O, RAM, CPU! That is the order you spend
your money, unless one can prove it otherwise.
Farmer.
-- Original Message --
From: "Hotmail" <>
To: "Hassan" <>
Sent: Sunday, November 27, 2005 10:28 AM
Subject: Re: CPU speed 1.9 and 2.6
> Hi Hassan,
> there one good article that came out lately that gives good explanation of
> how CPU speed, their level 2 and level 3 caches influence SQL performance.
> It's called "Bare-Metal Tuning"
> at
> http://www.windowsitpro.com/SQLServ...92.ht
ml
> It is for subscribers, therefore I can't post its contents here. You may
> want to subscribe to this magazine, it's very good.
> You don't provide enough info to make much conclusions about CPUs that you
> have, like their models, types, cache sizes and their quantities
> (hypothetical for your new server). The rest of the server construction is
> also important, like bus speeds, RAID types, raid controllers and on and
> on. All being equal, you will see lower performance but that is only if
> your SQL is CPU bound, i.e. the bottleneck is CPU. I would doubt that is
> the case as your I/O subsystem is usually is the first bottleneck, then
> memory then CPU. You have to monitor your system to know these factors.
> I can build a server with 4 x 1.9 Ghz cpus that will leave stock 2.6 Ghz
> server eating dust behind, (with smart RAID and RAID cache, several
> independent raid controllers and lots of main memory). It all depends a
> lot on what else is in the server.
> I would suggest you don't waste your company money; they can be spent with
> better ROI and use this 4 way server until you have performance statistics
> to prove you need more powerful CPUs and better server. I find that people
> tend to overbuy on unfounded theoretical performance fears just like many
> people overbuy insurance policies with 0 deductibles.
>
> Thanks
> Farmer.
"Bud Y. Zer" <bud@.Gibralter.Bra> wrote in message
news:ecwog%23R9FHA.252@.TK2MSFTNGP15.phx.gbl...
> It's your disk speed that measures performance! CPU is always your last
> bottleneck in a SQL Server. The first two are RAM and Disk. Why does
> everybody go out and buy shiny new processors to make their SQL Server
> faster?
> After you spend all your money, you discover there is no money left for a
> screaming fast disk subsystem.
> Ask your stump-stupid management to buy a screaming fast disk subsystem
> with many raid controllers. (remember PCI cards maxes at 133MB/sec)
>
> "Hassan" <hassan@.hotmail.com> wrote in message
> news:%23dyxV9l8FHA.3544@.TK2MSFTNGP09.phx.gbl...
>|||So thats nice to know.. So what does one need to ask ? So if i say give me
faster IO, what does that mean ? What do we get as standards and what should
we be getting ?
Please let me know so I know exactly what to ask for
"Farmer" <someone@.somewhere.com> wrote in message
news:%238KUl0t9FHA.4048@.TK2MSFTNGP10.phx.gbl...
> LOL! LOL!
> Bud, you nailed the point!
> this is what I wanted to post to newsgroups and somehow got it sent to
> email.
> Some people just don't get it. I/O, RAM, CPU! That is the order you spend
> your money, unless one can prove it otherwise.
> Farmer.
> -- Original Message --
> From: "Hotmail" <>
> To: "Hassan" <>
> Sent: Sunday, November 27, 2005 10:28 AM
> Subject: Re: CPU speed 1.9 and 2.6
>
>
>
> "Bud Y. Zer" <bud@.Gibralter.Bra> wrote in message
> news:ecwog%23R9FHA.252@.TK2MSFTNGP15.phx.gbl...
>|||You can start here.
http://www.microsoft.com/technet/pr...in/sqlops6.mspx
"Hassan" <hassan@.hotmail.com> wrote in message
news:e2aIw3Q%23FHA.3036@.TK2MSFTNGP10.phx.gbl...
> So thats nice to know.. So what does one need to ask ? So if i say give me
> faster IO, what does that mean ? What do we get as standards and what
> should we be getting ?
> Please let me know so I know exactly what to ask for
> "Farmer" <someone@.somewhere.com> wrote in message
> news:%238KUl0t9FHA.4048@.TK2MSFTNGP10.phx.gbl...
>
cpu quota / resource management
Hello *,
Is there a way to restrict resource consumption by user or connection?
If I execute some long running reports my complete server slowes down. I'd like to assign this reports only limited resources.
Thanks,
Michael
You can configure database mirroring for the target database in your production SQL instance and create snapshot on the mirror server (your backup SQL instnace) on different machine. The principle system can be considered as your normal OLTP business system and the mirror server can be used to support your reporting system. Since the reporting system will be run on differet SQL Server instance on different machine, it will not hurt your normal business onthe principle server. HTH|||Really your easy options are limited to setting query govenor which is time based not resource based.|||Thanks for the hint, "SET QUERY_GOVERNOR_COST_LIMIT" is useful in this context. Additional question:-Is there a way to cancel running querries? For instance by issuing a "cancel" call from a seperate thread?
Thanks,
Michael
Friday, February 17, 2012
counting problem...
SELECT COUNT(DefendantCase.ProsAtty) AS CountOfProsAtty
FROM DefendantCase LEFT JOIN DefendantEventPros ON DefendantCase.VBKey=DefendantEventPros.VBKey
WHERE DefendantCase.StatusID=17 AND DefendantCase.ProsAtty=55
AND DefendantEventPros.EventDate BETWEEN DATEADD(DAY,-60,GETDATE()) AND GETDATE() AND DefendantEventPros.EventID=9
This query is trying to find the total amount of cases where the statusid=17, the prosatty=55, the date is between today and 60 days ago, and there is an eventid=9.
now, i'm not getting errors in the query itself; it's just that it's inflating the total number. If a case has more than one eventid=9, it will include that extra in the results. I do not want to include those in the results. Does anyone have any suggestions? Thanks!select count(ProsAtty) AS CountOfProsAtty
from DefendantCase
where StatusID=17
and ProsAtty=55
and EventID=9
and exists
( select 937
from DefendantEventPros
where VBKey = DefendantCase.VBKey
and EventDate
between dateadd(day,-60,getdate())
and getdate() )|||I hope I don't show up in that result set :)|||select count(ProsAtty) AS CountOfProsAtty
from DefendantCase
where StatusID=17
and ProsAtty=55
and EventID=9
and exists
( select 937
from DefendantEventPros
where VBKey = DefendantCase.VBKey
and EventDate
between dateadd(day,-60,getdate())
and getdate() )
thank you! that works perfectly!