Thursday, March 29, 2012
Advice on SQL statement please.
filtered I get the sum of an amount Group By the type. What I would like to
do is use the exact qry using a differnet date, to generate a third column
called Prior12Mnths. How would I use my qry to accomplish this task.
I appreciate the help.
Here's my qry:
Select GroupType, Sum(SumRevAmt) as Last12Mnths
from MyQRY
Where Period = '200006'
Group by GroupType
Type Last12Mnths_200006 Prior12Mnths_199906
Airlines 1234.50 '
Concessions 73854.00 '
etc......Russell Verdun wrote:
> I have a query that generates the dataset below, based on the year being
> filtered I get the sum of an amount Group By the type. What I would like t
o
> do is use the exact qry using a differnet date, to generate a third column
> called Prior12Mnths. How would I use my qry to accomplish this task.
> I appreciate the help.
> Here's my qry:
> Select GroupType, Sum(SumRevAmt) as Last12Mnths
> from MyQRY
> Where Period = '200006'
> Group by GroupType
>
>
> Type Last12Mnths_200006 Prior12Mnths_199906
> Airlines 1234.50 '?
?
> Concessions 73854.00 '
> etc......
>
>
It's not clear from your example what this "other date" would be, so
I'll use a different example. Say I have a table containing
transactions, and each transaction consists of an account, a transaction
date, and an amount:
SELECT
account,
SUM(CASE WHEN DATEDIFF(m, transdate, GETDATE()) <= 12 THEN amount
ELSE 0) AS Last12Months,
SUM(CASE WHEN DATEDIFF(m, transdate, GETDATE()) BETWEEN 13 AND 24
THEN amount ELSE 0) AS Prev12Months
FROM table
GROUP BY account
Is that enough to get you started?|||Tracy McKibben wrote:
> Russell Verdun wrote:
> It's not clear from your example what this "other date" would be, so
> I'll use a different example. Say I have a table containing
> transactions, and each transaction consists of an account, a transaction
> date, and an amount:
> SELECT
> account,
> SUM(CASE WHEN DATEDIFF(m, transdate, GETDATE()) <= 12 THEN amount
> ELSE 0) AS Last12Months,
> SUM(CASE WHEN DATEDIFF(m, transdate, GETDATE()) BETWEEN 13 AND 24
> THEN amount ELSE 0) AS Prev12Months
> FROM table
> GROUP BY account
> Is that enough to get you started?
>
Sorry, those CASE statements are missing ENDs...|||Hi Russell,
I believe you could do something like this:
Select GroupType, Sum(CASE Period=200006 THEN SumRevAmt ELSE 0 END) as
Last12Mnths, Sum(CASE Period=199906 THEN SumRevAmt ELSE 0 END) as
Prior12Mnths
from MyQRY
Where Period = '200006' or Period = '199906'
Group by GroupType
I Dont know if thats the best way, but that is what first comes to
mind.
Paul T.|||>> I have a query that generates the dataset below, based on the year being
filtered I get the sum of an amount Group By the type. What I would like to
do is use the exact qry using a differnet date, to generate a third column
called Prior12Mnths. <<
Please post DDL, so that people do not have to guess what the keys,
constraints, Declarative Referential Integrity, data types, etc. in
your schema are. Sample data is also a good idea, along with clear
specifications. It is also helpful if the data elements have good
names.
CREATE TABLE Revenues -- guess at meaningful name
(grp_type INTEGER NOT NULL
REFERENCES GroupTypes(grp_type),
rev_amt DECIMAL(12,2) NOT NULL,
rev_date DATETIME NOT NULL PRIMARY KEY);
In the vague pseudo-code you posted, only some kind of vague date can
be a key
The best trick for this kind of summary is to build a reporting range
table
CREATE TABLE ReportRanges
(range_name CHAR() NOT NULL,
start_date DATETIME NOT NULL,
end_date DATETIME NOT NULL,
CHECK (start_date < end_date),
PRIMARY KEY (range_name, start_date));
INSERT INTO ReportRanges
VALUES ('2006-06: Prior12' , '2005-06-01', '2006-06-31' );
INSERT INTO ReportRanges
VALUES ('2006-06: ytd' , '2006-01-01', '2006-06-31' );
SELECT grp_type,
SUM (CASE WHEN R.range_name = '2006-06: ytd'
THEN rev_amt ELSE 0.00 END) AS ytd,
SUM (CASE WHEN R.range_name = '2006-06: Prior12'
THEN rev_amt ELSE 0.00 END) AS Prior12,
etc.
FROM Revenues
GROUP BY grp_type;
Adjust the table as needed.
Advice on SQL Server 2005 vs. Express Edition w/ Advanced Services
I've been using SQL Server 2005 Std. for my development work on a laptop w/ 2 GHz Celeron and 768 Mb RAM. Now that Express Edition has Reporting Services and Full-Text Search, would I be wise to just use it instead? I actually have both on my machine since Express Edition installed with VS 2005 Standard. Also, if I uninstall SQL Server 2005 Std. what will I lose? Thanks in advance.
-Mike
It depends what you want to do. SQL Express Advanced Services is not the same as Std, Std has more features (OLAP, Integration Services) richer features (better SSMS, better reporting including report builder) it also has less restrictions on memory, procs etc.
If you are only using this for development you should also be able to use Developer Edition which is < 50USD but is Enterprise Edition, with a no production use clause.
|||I've decided to uninstall SQL Server 2005 Std. and try to work with Express w/ Advanced Services. I believe it will do all I need. I'm more concerned with performance on my laptop than features like OLAP, etc. If I gain any incite after using it for a while, I'll post back here. Thanks.
-Mike
sqlAdvice on SQL 2005 Install
I am looking for some advice on installing SQL 2005 x64 Standard on a
new Windows 2003 x64 Standard Dell 2950 Box. We have a Quad 2.6 GHz
with 16 GBs Memory, 5x 73 GB 15k RPM Hard drives.
A couple things we are looking into is the best way to partition the
Raid 5, what we have come up with so far is to create an OS partition,
Backup Partition, Temp DB partition, and Everything else Partition.
We would like to stay with raid 5.
Next is there any to make Windows 2003 STD work better for SQL on a
fresh install?
SQL tips, We have read up on a few such as dedicating processor to the
Temp DB. We use our DB for an in-house sales package (software
designer included), Great Plains, and a CRM program.
Thanks for any help.
Don Graham
Why do you want to partition the drives? That does absolutely nothing for
performance since they are all on the same physical array. By partitioning
the array you now run into a situation where one or more of the partitions
may be too small down the road. And why do you want to stay with Raid 5?
Is 5 disks the max you can have in the box? I don't know who large your dbs
will be or how you will use them but if performance is a goal placing
everything on a single Raid 5 may not be the best option in the long run.
Andrew J. Kelly SQL MVP
"Donnie3iii" <donnie3iii@.gmail.com> wrote in message
news:1184020787.195967.302410@.e16g2000pri.googlegr oups.com...
> Hello,
> I am looking for some advice on installing SQL 2005 x64 Standard on a
> new Windows 2003 x64 Standard Dell 2950 Box. We have a Quad 2.6 GHz
> with 16 GBs Memory, 5x 73 GB 15k RPM Hard drives.
> A couple things we are looking into is the best way to partition the
> Raid 5, what we have come up with so far is to create an OS partition,
> Backup Partition, Temp DB partition, and Everything else Partition.
> We would like to stay with raid 5.
> Next is there any to make Windows 2003 STD work better for SQL on a
> fresh install?
> SQL tips, We have read up on a few such as dedicating processor to the
> Temp DB. We use our DB for an in-house sales package (software
> designer included), Great Plains, and a CRM program.
> Thanks for any help.
> Don Graham
>
|||On Jul 9, 3:59 pm, "Andrew J. Kelly" <sqlmvpnooos...@.shadhawk.com>
wrote:[vbcol=seagreen]
> Why do you want to partition the drives? That does absolutely nothing for
> performance since they are all on the same physical array. By partitioning
> the array you now run into a situation where one or more of the partitions
> may be too small down the road. And why do you want to stay with Raid 5?
> Is 5 disks the max you can have in the box? I don't know who large your dbs
> will be or how you will use them but if performance is a goal placing
> everything on a single Raid 5 may not be the best option in the long run.
> --
> Andrew J. Kelly SQL MVP
> "Donnie3iii" <donnie3...@.gmail.com> wrote in message
> news:1184020787.195967.302410@.e16g2000pri.googlegr oups.com...
>
>
>
>
The database size will total around 20-25GB (for now, they grow at a
rate of 7 GBs a year), as for Raid 5 we were going to go with Raid 10
but we went with the 15k drives instead. Our programmer/dbo swears by
Raid 5. We can have up to 8 drives in the box but cost was a
consideration here.
|||Well without knowing more about how you will actually use this server I
can't say whether you will have issues with the Raid 5 or not. But if your
programmer swears by them who am I to say .
Andrew J. Kelly SQL MVP
"Donnie3iii" <donnie3iii@.gmail.com> wrote in message
news:1184022630.326849.120520@.j4g2000prf.googlegro ups.com...
> On Jul 9, 3:59 pm, "Andrew J. Kelly" <sqlmvpnooos...@.shadhawk.com>
> wrote:
> The database size will total around 20-25GB (for now, they grow at a
> rate of 7 GBs a year), as for Raid 5 we were going to go with Raid 10
> but we went with the 15k drives instead. Our programmer/dbo swears by
> Raid 5. We can have up to 8 drives in the box but cost was a
> consideration here.
>
|||On Jul 9, 8:04 pm, "Andrew J. Kelly" <sqlmvpnooos...@.shadhawk.com>
wrote:[vbcol=seagreen]
> Well without knowing more about how you will actually use this server I
> can't say whether you will have issues with the Raid 5 or not. But if your
> programmer swears by them who am I to say .
> --
> Andrew J. Kelly SQL MVP
> "Donnie3iii" <donnie3...@.gmail.com> wrote in message
> news:1184022630.326849.120520@.j4g2000prf.googlegro ups.com...
>
>
>
>
>
>
"But if your programmer swears by them who am I to say"
That was my thought as well but the more I look into it the more I
start to disagree. I may go for a raid 1 (OS), Raid 1 (Trans log or
TempDB), and I am not sure for the DB drive. Raid 10 is a little to
expensive.
Overall we have about 25-30 users, it looks like a lot of database
operations for the program are done with stored procedures.
|||You have plenty of cache so hopefully you won't need to do as much I/O on
the data drives. So if you separate the Tran logs fromt he data files you
will have a good start. By the way if price is an issue I would look at
placing the Log files on the same Raid 1 as the OS. As long as you don't
have other apps using the OS drive there isn't much activity and most small
to medium size apps do fine with sharing the logs and OS. That will give you
more drives for the data array.
Andrew J. Kelly SQL MVP
"Donnie3iii" <donnie3iii@.gmail.com> wrote in message
news:1184081530.969779.121120@.i13g2000prf.googlegr oups.com...
> On Jul 9, 8:04 pm, "Andrew J. Kelly" <sqlmvpnooos...@.shadhawk.com>
> wrote:
> "But if your programmer swears by them who am I to say"
> That was my thought as well but the more I look into it the more I
> start to disagree. I may go for a raid 1 (OS), Raid 1 (Trans log or
> TempDB), and I am not sure for the DB drive. Raid 10 is a little to
> expensive.
> Overall we have about 25-30 users, it looks like a lot of database
> operations for the program are done with stored procedures.
>
|||On Jul 11, 5:38 am, "Rasmus Glibstrup" <ras...@.it-
craft.THIS.REMOVE.dk> wrote:[vbcol=seagreen]
> I would go fo a tripple RAID 1, one for OS, one for Log and One for DB
> files.
> To begin with I would place the TempDB as any other database, unless your
> applications require much use of TempDB.
> But generally my experience is never to use RAID 5 unless you have a very
> large percentage of reads as opposed to writes on your database. And even
> then I would go for RAID 10.
> Maybe you want to take a look at point 2,3 and 5 in this from MS:http://www.microsoft.com/technet/prodtechnol/sql/bestpractice/storage...
> --
> Rasmus Glibstrup
> MCDBA,MCITP (dba,dev,bi)
> "Donnie3iii" <donnie3...@.gmail.com> wrote in message
> news:1184081530.969779.121120@.i13g2000prf.googlegr oups.com...
>
>
>
>
>
>
>
>
>
>
Thank you all for the suggestions, I am planning on reconfiguring the
raid and going with either 2 or 3 depending on how much money I can
squeeze out. Thanks!
Don
Advice on SQL 2005 Install
I am looking for some advice on installing SQL 2005 x64 Standard on a
new Windows 2003 x64 Standard Dell 2950 Box. We have a Quad 2.6 GHz
with 16 GBs Memory, 5x 73 GB 15k RPM Hard drives.
A couple things we are looking into is the best way to partition the
Raid 5, what we have come up with so far is to create an OS partition,
Backup Partition, Temp DB partition, and Everything else Partition.
We would like to stay with raid 5.
Next is there any to make Windows 2003 STD work better for SQL on a
fresh install?
SQL tips, We have read up on a few such as dedicating processor to the
Temp DB. We use our DB for an in-house sales package (software
designer included), Great Plains, and a CRM program.
Thanks for any help.
Don GrahamWhy do you want to partition the drives? That does absolutely nothing for
performance since they are all on the same physical array. By partitioning
the array you now run into a situation where one or more of the partitions
may be too small down the road. And why do you want to stay with Raid 5?
Is 5 disks the max you can have in the box? I don't know who large your dbs
will be or how you will use them but if performance is a goal placing
everything on a single Raid 5 may not be the best option in the long run.
Andrew J. Kelly SQL MVP
"Donnie3iii" <donnie3iii@.gmail.com> wrote in message
news:1184020787.195967.302410@.e16g2000pri.googlegroups.com...
> Hello,
> I am looking for some advice on installing SQL 2005 x64 Standard on a
> new Windows 2003 x64 Standard Dell 2950 Box. We have a Quad 2.6 GHz
> with 16 GBs Memory, 5x 73 GB 15k RPM Hard drives.
> A couple things we are looking into is the best way to partition the
> Raid 5, what we have come up with so far is to create an OS partition,
> Backup Partition, Temp DB partition, and Everything else Partition.
> We would like to stay with raid 5.
> Next is there any to make Windows 2003 STD work better for SQL on a
> fresh install?
> SQL tips, We have read up on a few such as dedicating processor to the
> Temp DB. We use our DB for an in-house sales package (software
> designer included), Great Plains, and a CRM program.
> Thanks for any help.
> Don Graham
>|||On Jul 9, 3:59 pm, "Andrew J. Kelly" <sqlmvpnooos...@.shadhawk.com>
wrote:[vbcol=seagreen]
> Why do you want to partition the drives? That does absolutely nothing for
> performance since they are all on the same physical array. By partitioning
> the array you now run into a situation where one or more of the partitions
> may be too small down the road. And why do you want to stay with Raid 5?
> Is 5 disks the max you can have in the box? I don't know who large your db
s
> will be or how you will use them but if performance is a goal placing
> everything on a single Raid 5 may not be the best option in the long run.
> --
> Andrew J. Kelly SQL MVP
> "Donnie3iii" <donnie3...@.gmail.com> wrote in message
> news:1184020787.195967.302410@.e16g2000pri.googlegroups.com...
>
>
>
>
>
>
>
>
The database size will total around 20-25GB (for now, they grow at a
rate of 7 GBs a year), as for Raid 5 we were going to go with Raid 10
but we went with the 15k drives instead. Our programmer/dbo swears by
Raid 5. We can have up to 8 drives in the box but cost was a
consideration here.|||Well without knowing more about how you will actually use this server I
can't say whether you will have issues with the Raid 5 or not. But if your
programmer swears by them who am I to say .
Andrew J. Kelly SQL MVP
"Donnie3iii" <donnie3iii@.gmail.com> wrote in message
news:1184022630.326849.120520@.j4g2000prf.googlegroups.com...
> On Jul 9, 3:59 pm, "Andrew J. Kelly" <sqlmvpnooos...@.shadhawk.com>
> wrote:
> The database size will total around 20-25GB (for now, they grow at a
> rate of 7 GBs a year), as for Raid 5 we were going to go with Raid 10
> but we went with the 15k drives instead. Our programmer/dbo swears by
> Raid 5. We can have up to 8 drives in the box but cost was a
> consideration here.
>|||On Jul 9, 8:04 pm, "Andrew J. Kelly" <sqlmvpnooos...@.shadhawk.com>
wrote:[vbcol=seagreen]
> Well without knowing more about how you will actually use this server I
> can't say whether you will have issues with the Raid 5 or not. But if you
r
> programmer swears by them who am I to say .
> --
> Andrew J. Kelly SQL MVP
> "Donnie3iii" <donnie3...@.gmail.com> wrote in message
> news:1184022630.326849.120520@.j4g2000prf.googlegroups.com...
>
>
>
>
>
>
>
>
>
>
>
>
>
"But if your programmer swears by them who am I to say"
That was my thought as well but the more I look into it the more I
start to disagree. I may go for a raid 1 (OS), Raid 1 (Trans log or
TempDB), and I am not sure for the DB drive. Raid 10 is a little to
expensive.
Overall we have about 25-30 users, it looks like a lot of database
operations for the program are done with stored procedures.|||You have plenty of cache so hopefully you won't need to do as much I/O on
the data drives. So if you separate the Tran logs fromt he data files you
will have a good start. By the way if price is an issue I would look at
placing the Log files on the same Raid 1 as the OS. As long as you don't
have other apps using the OS drive there isn't much activity and most small
to medium size apps do fine with sharing the logs and OS. That will give you
more drives for the data array.
Andrew J. Kelly SQL MVP
"Donnie3iii" <donnie3iii@.gmail.com> wrote in message
news:1184081530.969779.121120@.i13g2000prf.googlegroups.com...
> On Jul 9, 8:04 pm, "Andrew J. Kelly" <sqlmvpnooos...@.shadhawk.com>
> wrote:
> "But if your programmer swears by them who am I to say"
> That was my thought as well but the more I look into it the more I
> start to disagree. I may go for a raid 1 (OS), Raid 1 (Trans log or
> TempDB), and I am not sure for the DB drive. Raid 10 is a little to
> expensive.
> Overall we have about 25-30 users, it looks like a lot of database
> operations for the program are done with stored procedures.
>|||I would go fo a tripple RAID 1, one for OS, one for Log and One for DB
files.
To begin with I would place the TempDB as any other database, unless your
applications require much use of TempDB.
But generally my experience is never to use RAID 5 unless you have a very
large percentage of reads as opposed to writes on your database. And even
then I would go for RAID 10.
Maybe you want to take a look at point 2,3 and 5 in this from MS:
[url]http://www.microsoft.com/technet/prodtechnol/sql/bestpractice/storage-top-10.mspx[
/url]
Rasmus Glibstrup
MCDBA,MCITP (dba,dev,bi)
"Donnie3iii" <donnie3iii@.gmail.com> wrote in message
news:1184081530.969779.121120@.i13g2000prf.googlegroups.com...
> On Jul 9, 8:04 pm, "Andrew J. Kelly" <sqlmvpnooos...@.shadhawk.com>
> wrote:
> "But if your programmer swears by them who am I to say"
> That was my thought as well but the more I look into it the more I
> start to disagree. I may go for a raid 1 (OS), Raid 1 (Trans log or
> TempDB), and I am not sure for the DB drive. Raid 10 is a little to
> expensive.
> Overall we have about 25-30 users, it looks like a lot of database
> operations for the program are done with stored procedures.
>|||On Jul 11, 5:38 am, "Rasmus Glibstrup" <ras...@.it-
craft.THIS.REMOVE.dk> wrote:[vbcol=seagreen]
> I would go fo a tripple RAID 1, one for OS, one for Log and One for DB
> files.
> To begin with I would place the TempDB as any other database, unless your
> applications require much use of TempDB.
> But generally my experience is never to use RAID 5 unless you have a very
> large percentage of reads as opposed to writes on your database. And even
> then I would go for RAID 10.
> Maybe you want to take a look at point 2,3 and 5 in this from MS:http://www.micr
osoft.com/te...tice/storage...
> --
> Rasmus Glibstrup
> MCDBA,MCITP (dba,dev,bi)
> "Donnie3iii" <donnie3...@.gmail.com> wrote in message
> news:1184081530.969779.121120@.i13g2000prf.googlegroups.com...
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
Thank you all for the suggestions, I am planning on reconfiguring the
raid and going with either 2 or 3 depending on how much money I can
squeeze out. Thanks!
Don
Advice on SQL 2005 Install
I am looking for some advice on installing SQL 2005 x64 Standard on a
new Windows 2003 x64 Standard Dell 2950 Box. We have a Quad 2.6 GHz
with 16 GBs Memory, 5x 73 GB 15k RPM Hard drives.
A couple things we are looking into is the best way to partition the
Raid 5, what we have come up with so far is to create an OS partition,
Backup Partition, Temp DB partition, and Everything else Partition.
We would like to stay with raid 5.
Next is there any to make Windows 2003 STD work better for SQL on a
fresh install?
SQL tips, We have read up on a few such as dedicating processor to the
Temp DB. We use our DB for an in-house sales package (software
designer included), Great Plains, and a CRM program.
Thanks for any help.
Don GrahamWhy do you want to partition the drives? That does absolutely nothing for
performance since they are all on the same physical array. By partitioning
the array you now run into a situation where one or more of the partitions
may be too small down the road. And why do you want to stay with Raid 5?
Is 5 disks the max you can have in the box? I don't know who large your dbs
will be or how you will use them but if performance is a goal placing
everything on a single Raid 5 may not be the best option in the long run.
--
Andrew J. Kelly SQL MVP
"Donnie3iii" <donnie3iii@.gmail.com> wrote in message
news:1184020787.195967.302410@.e16g2000pri.googlegroups.com...
> Hello,
> I am looking for some advice on installing SQL 2005 x64 Standard on a
> new Windows 2003 x64 Standard Dell 2950 Box. We have a Quad 2.6 GHz
> with 16 GBs Memory, 5x 73 GB 15k RPM Hard drives.
> A couple things we are looking into is the best way to partition the
> Raid 5, what we have come up with so far is to create an OS partition,
> Backup Partition, Temp DB partition, and Everything else Partition.
> We would like to stay with raid 5.
> Next is there any to make Windows 2003 STD work better for SQL on a
> fresh install?
> SQL tips, We have read up on a few such as dedicating processor to the
> Temp DB. We use our DB for an in-house sales package (software
> designer included), Great Plains, and a CRM program.
> Thanks for any help.
> Don Graham
>|||On Jul 9, 3:59 pm, "Andrew J. Kelly" <sqlmvpnooos...@.shadhawk.com>
wrote:
> Why do you want to partition the drives? That does absolutely nothing for
> performance since they are all on the same physical array. By partitioning
> the array you now run into a situation where one or more of the partitions
> may be too small down the road. And why do you want to stay with Raid 5?
> Is 5 disks the max you can have in the box? I don't know who large your dbs
> will be or how you will use them but if performance is a goal placing
> everything on a single Raid 5 may not be the best option in the long run.
> --
> Andrew J. Kelly SQL MVP
> "Donnie3iii" <donnie3...@.gmail.com> wrote in message
> news:1184020787.195967.302410@.e16g2000pri.googlegroups.com...
> > Hello,
> > I am looking for some advice on installing SQL 2005 x64 Standard on a
> > new Windows 2003 x64 Standard Dell 2950 Box. We have a Quad 2.6 GHz
> > with 16 GBs Memory, 5x 73 GB 15k RPM Hard drives.
> > A couple things we are looking into is the best way to partition the
> > Raid 5, what we have come up with so far is to create an OS partition,
> > Backup Partition, Temp DB partition, and Everything else Partition.
> > We would like to stay with raid 5.
> > Next is there any to make Windows 2003 STD work better for SQL on a
> > fresh install?
> > SQL tips, We have read up on a few such as dedicating processor to the
> > Temp DB. We use our DB for an in-house sales package (software
> > designer included), Great Plains, and a CRM program.
> > Thanks for any help.
> > Don Graham
The database size will total around 20-25GB (for now, they grow at a
rate of 7 GBs a year), as for Raid 5 we were going to go with Raid 10
but we went with the 15k drives instead. Our programmer/dbo swears by
Raid 5. We can have up to 8 drives in the box but cost was a
consideration here.|||Well without knowing more about how you will actually use this server I
can't say whether you will have issues with the Raid 5 or not. But if your
programmer swears by them who am I to say :).
--
Andrew J. Kelly SQL MVP
"Donnie3iii" <donnie3iii@.gmail.com> wrote in message
news:1184022630.326849.120520@.j4g2000prf.googlegroups.com...
> On Jul 9, 3:59 pm, "Andrew J. Kelly" <sqlmvpnooos...@.shadhawk.com>
> wrote:
>> Why do you want to partition the drives? That does absolutely nothing
>> for
>> performance since they are all on the same physical array. By
>> partitioning
>> the array you now run into a situation where one or more of the
>> partitions
>> may be too small down the road. And why do you want to stay with Raid 5?
>> Is 5 disks the max you can have in the box? I don't know who large your
>> dbs
>> will be or how you will use them but if performance is a goal placing
>> everything on a single Raid 5 may not be the best option in the long run.
>> --
>> Andrew J. Kelly SQL MVP
>> "Donnie3iii" <donnie3...@.gmail.com> wrote in message
>> news:1184020787.195967.302410@.e16g2000pri.googlegroups.com...
>> > Hello,
>> > I am looking for some advice on installing SQL 2005 x64 Standard on a
>> > new Windows 2003 x64 Standard Dell 2950 Box. We have a Quad 2.6 GHz
>> > with 16 GBs Memory, 5x 73 GB 15k RPM Hard drives.
>> > A couple things we are looking into is the best way to partition the
>> > Raid 5, what we have come up with so far is to create an OS partition,
>> > Backup Partition, Temp DB partition, and Everything else Partition.
>> > We would like to stay with raid 5.
>> > Next is there any to make Windows 2003 STD work better for SQL on a
>> > fresh install?
>> > SQL tips, We have read up on a few such as dedicating processor to the
>> > Temp DB. We use our DB for an in-house sales package (software
>> > designer included), Great Plains, and a CRM program.
>> > Thanks for any help.
>> > Don Graham
> The database size will total around 20-25GB (for now, they grow at a
> rate of 7 GBs a year), as for Raid 5 we were going to go with Raid 10
> but we went with the 15k drives instead. Our programmer/dbo swears by
> Raid 5. We can have up to 8 drives in the box but cost was a
> consideration here.
>|||On Jul 9, 8:04 pm, "Andrew J. Kelly" <sqlmvpnooos...@.shadhawk.com>
wrote:
> Well without knowing more about how you will actually use this server I
> can't say whether you will have issues with the Raid 5 or not. But if your
> programmer swears by them who am I to say :).
> --
> Andrew J. Kelly SQL MVP
> "Donnie3iii" <donnie3...@.gmail.com> wrote in message
> news:1184022630.326849.120520@.j4g2000prf.googlegroups.com...
> > On Jul 9, 3:59 pm, "Andrew J. Kelly" <sqlmvpnooos...@.shadhawk.com>
> > wrote:
> >> Why do you want to partition the drives? That does absolutely nothing
> >> for
> >> performance since they are all on the same physical array. By
> >> partitioning
> >> the array you now run into a situation where one or more of the
> >> partitions
> >> may be too small down the road. And why do you want to stay with Raid 5?
> >> Is 5 disks the max you can have in the box? I don't know who large your
> >> dbs
> >> will be or how you will use them but if performance is a goal placing
> >> everything on a single Raid 5 may not be the best option in the long run.
> >> --
> >> Andrew J. Kelly SQL MVP
> >> "Donnie3iii" <donnie3...@.gmail.com> wrote in message
> >>news:1184020787.195967.302410@.e16g2000pri.googlegroups.com...
> >> > Hello,
> >> > I am looking for some advice on installing SQL 2005 x64 Standard on a
> >> > new Windows 2003 x64 Standard Dell 2950 Box. We have a Quad 2.6 GHz
> >> > with 16 GBs Memory, 5x 73 GB 15k RPM Hard drives.
> >> > A couple things we are looking into is the best way to partition the
> >> > Raid 5, what we have come up with so far is to create an OS partition,
> >> > Backup Partition, Temp DB partition, and Everything else Partition.
> >> > We would like to stay with raid 5.
> >> > Next is there any to make Windows 2003 STD work better for SQL on a
> >> > fresh install?
> >> > SQL tips, We have read up on a few such as dedicating processor to the
> >> > Temp DB. We use our DB for an in-house sales package (software
> >> > designer included), Great Plains, and a CRM program.
> >> > Thanks for any help.
> >> > Don Graham
> > The database size will total around 20-25GB (for now, they grow at a
> > rate of 7 GBs a year), as for Raid 5 we were going to go with Raid 10
> > but we went with the 15k drives instead. Our programmer/dbo swears by
> > Raid 5. We can have up to 8 drives in the box but cost was a
> > consideration here.
"But if your programmer swears by them who am I to say"
That was my thought as well but the more I look into it the more I
start to disagree. I may go for a raid 1 (OS), Raid 1 (Trans log or
TempDB), and I am not sure for the DB drive. Raid 10 is a little to
expensive.
Overall we have about 25-30 users, it looks like a lot of database
operations for the program are done with stored procedures.|||You have plenty of cache so hopefully you won't need to do as much I/O on
the data drives. So if you separate the Tran logs fromt he data files you
will have a good start. By the way if price is an issue I would look at
placing the Log files on the same Raid 1 as the OS. As long as you don't
have other apps using the OS drive there isn't much activity and most small
to medium size apps do fine with sharing the logs and OS. That will give you
more drives for the data array.
--
Andrew J. Kelly SQL MVP
"Donnie3iii" <donnie3iii@.gmail.com> wrote in message
news:1184081530.969779.121120@.i13g2000prf.googlegroups.com...
> On Jul 9, 8:04 pm, "Andrew J. Kelly" <sqlmvpnooos...@.shadhawk.com>
> wrote:
>> Well without knowing more about how you will actually use this server I
>> can't say whether you will have issues with the Raid 5 or not. But if
>> your
>> programmer swears by them who am I to say :).
>> --
>> Andrew J. Kelly SQL MVP
>> "Donnie3iii" <donnie3...@.gmail.com> wrote in message
>> news:1184022630.326849.120520@.j4g2000prf.googlegroups.com...
>> > On Jul 9, 3:59 pm, "Andrew J. Kelly" <sqlmvpnooos...@.shadhawk.com>
>> > wrote:
>> >> Why do you want to partition the drives? That does absolutely nothing
>> >> for
>> >> performance since they are all on the same physical array. By
>> >> partitioning
>> >> the array you now run into a situation where one or more of the
>> >> partitions
>> >> may be too small down the road. And why do you want to stay with Raid
>> >> 5?
>> >> Is 5 disks the max you can have in the box? I don't know who large
>> >> your
>> >> dbs
>> >> will be or how you will use them but if performance is a goal placing
>> >> everything on a single Raid 5 may not be the best option in the long
>> >> run.
>> >> --
>> >> Andrew J. Kelly SQL MVP
>> >> "Donnie3iii" <donnie3...@.gmail.com> wrote in message
>> >>news:1184020787.195967.302410@.e16g2000pri.googlegroups.com...
>> >> > Hello,
>> >> > I am looking for some advice on installing SQL 2005 x64 Standard on
>> >> > a
>> >> > new Windows 2003 x64 Standard Dell 2950 Box. We have a Quad 2.6 GHz
>> >> > with 16 GBs Memory, 5x 73 GB 15k RPM Hard drives.
>> >> > A couple things we are looking into is the best way to partition the
>> >> > Raid 5, what we have come up with so far is to create an OS
>> >> > partition,
>> >> > Backup Partition, Temp DB partition, and Everything else Partition.
>> >> > We would like to stay with raid 5.
>> >> > Next is there any to make Windows 2003 STD work better for SQL on a
>> >> > fresh install?
>> >> > SQL tips, We have read up on a few such as dedicating processor to
>> >> > the
>> >> > Temp DB. We use our DB for an in-house sales package (software
>> >> > designer included), Great Plains, and a CRM program.
>> >> > Thanks for any help.
>> >> > Don Graham
>> > The database size will total around 20-25GB (for now, they grow at a
>> > rate of 7 GBs a year), as for Raid 5 we were going to go with Raid 10
>> > but we went with the 15k drives instead. Our programmer/dbo swears by
>> > Raid 5. We can have up to 8 drives in the box but cost was a
>> > consideration here.
> "But if your programmer swears by them who am I to say"
> That was my thought as well but the more I look into it the more I
> start to disagree. I may go for a raid 1 (OS), Raid 1 (Trans log or
> TempDB), and I am not sure for the DB drive. Raid 10 is a little to
> expensive.
> Overall we have about 25-30 users, it looks like a lot of database
> operations for the program are done with stored procedures.
>|||I would go fo a tripple RAID 1, one for OS, one for Log and One for DB
files.
To begin with I would place the TempDB as any other database, unless your
applications require much use of TempDB.
But generally my experience is never to use RAID 5 unless you have a very
large percentage of reads as opposed to writes on your database. And even
then I would go for RAID 10.
Maybe you want to take a look at point 2,3 and 5 in this from MS:
http://www.microsoft.com/technet/prodtechnol/sql/bestpractice/storage-top-10.mspx
--
Rasmus Glibstrup
MCDBA,MCITP (dba,dev,bi)
"Donnie3iii" <donnie3iii@.gmail.com> wrote in message
news:1184081530.969779.121120@.i13g2000prf.googlegroups.com...
> On Jul 9, 8:04 pm, "Andrew J. Kelly" <sqlmvpnooos...@.shadhawk.com>
> wrote:
>> Well without knowing more about how you will actually use this server I
>> can't say whether you will have issues with the Raid 5 or not. But if
>> your
>> programmer swears by them who am I to say :).
>> --
>> Andrew J. Kelly SQL MVP
>> "Donnie3iii" <donnie3...@.gmail.com> wrote in message
>> news:1184022630.326849.120520@.j4g2000prf.googlegroups.com...
>> > On Jul 9, 3:59 pm, "Andrew J. Kelly" <sqlmvpnooos...@.shadhawk.com>
>> > wrote:
>> >> Why do you want to partition the drives? That does absolutely nothing
>> >> for
>> >> performance since they are all on the same physical array. By
>> >> partitioning
>> >> the array you now run into a situation where one or more of the
>> >> partitions
>> >> may be too small down the road. And why do you want to stay with Raid
>> >> 5?
>> >> Is 5 disks the max you can have in the box? I don't know who large
>> >> your
>> >> dbs
>> >> will be or how you will use them but if performance is a goal placing
>> >> everything on a single Raid 5 may not be the best option in the long
>> >> run.
>> >> --
>> >> Andrew J. Kelly SQL MVP
>> >> "Donnie3iii" <donnie3...@.gmail.com> wrote in message
>> >>news:1184020787.195967.302410@.e16g2000pri.googlegroups.com...
>> >> > Hello,
>> >> > I am looking for some advice on installing SQL 2005 x64 Standard on
>> >> > a
>> >> > new Windows 2003 x64 Standard Dell 2950 Box. We have a Quad 2.6 GHz
>> >> > with 16 GBs Memory, 5x 73 GB 15k RPM Hard drives.
>> >> > A couple things we are looking into is the best way to partition the
>> >> > Raid 5, what we have come up with so far is to create an OS
>> >> > partition,
>> >> > Backup Partition, Temp DB partition, and Everything else Partition.
>> >> > We would like to stay with raid 5.
>> >> > Next is there any to make Windows 2003 STD work better for SQL on a
>> >> > fresh install?
>> >> > SQL tips, We have read up on a few such as dedicating processor to
>> >> > the
>> >> > Temp DB. We use our DB for an in-house sales package (software
>> >> > designer included), Great Plains, and a CRM program.
>> >> > Thanks for any help.
>> >> > Don Graham
>> > The database size will total around 20-25GB (for now, they grow at a
>> > rate of 7 GBs a year), as for Raid 5 we were going to go with Raid 10
>> > but we went with the 15k drives instead. Our programmer/dbo swears by
>> > Raid 5. We can have up to 8 drives in the box but cost was a
>> > consideration here.
> "But if your programmer swears by them who am I to say"
> That was my thought as well but the more I look into it the more I
> start to disagree. I may go for a raid 1 (OS), Raid 1 (Trans log or
> TempDB), and I am not sure for the DB drive. Raid 10 is a little to
> expensive.
> Overall we have about 25-30 users, it looks like a lot of database
> operations for the program are done with stored procedures.
>|||On Jul 11, 5:38 am, "Rasmus Glibstrup" <ras...@.it-
craft.THIS.REMOVE.dk> wrote:
> I would go fo a tripple RAID 1, one for OS, one for Log and One for DB
> files.
> To begin with I would place the TempDB as any other database, unless your
> applications require much use of TempDB.
> But generally my experience is never to use RAID 5 unless you have a very
> large percentage of reads as opposed to writes on your database. And even
> then I would go for RAID 10.
> Maybe you want to take a look at point 2,3 and 5 in this from MS:http://www.microsoft.com/technet/prodtechnol/sql/bestpractice/storage...
> --
> Rasmus Glibstrup
> MCDBA,MCITP (dba,dev,bi)
> "Donnie3iii" <donnie3...@.gmail.com> wrote in message
> news:1184081530.969779.121120@.i13g2000prf.googlegroups.com...
> > On Jul 9, 8:04 pm, "Andrew J. Kelly" <sqlmvpnooos...@.shadhawk.com>
> > wrote:
> >> Well without knowing more about how you will actually use this server I
> >> can't say whether you will have issues with the Raid 5 or not. But if
> >> your
> >> programmer swears by them who am I to say :).
> >> --
> >> Andrew J. Kelly SQL MVP
> >> "Donnie3iii" <donnie3...@.gmail.com> wrote in message
> >>news:1184022630.326849.120520@.j4g2000prf.googlegroups.com...
> >> > On Jul 9, 3:59 pm, "Andrew J. Kelly" <sqlmvpnooos...@.shadhawk.com>
> >> > wrote:
> >> >> Why do you want to partition the drives? That does absolutely nothing
> >> >> for
> >> >> performance since they are all on the same physical array. By
> >> >> partitioning
> >> >> the array you now run into a situation where one or more of the
> >> >> partitions
> >> >> may be too small down the road. And why do you want to stay with Raid
> >> >> 5?
> >> >> Is 5 disks the max you can have in the box? I don't know who large
> >> >> your
> >> >> dbs
> >> >> will be or how you will use them but if performance is a goal placing
> >> >> everything on a single Raid 5 may not be the best option in the long
> >> >> run.
> >> >> --
> >> >> Andrew J. Kelly SQL MVP
> >> >> "Donnie3iii" <donnie3...@.gmail.com> wrote in message
> >> >>news:1184020787.195967.302410@.e16g2000pri.googlegroups.com...
> >> >> > Hello,
> >> >> > I am looking for some advice on installing SQL 2005 x64 Standard on
> >> >> > a
> >> >> > new Windows 2003 x64 Standard Dell 2950 Box. We have a Quad 2.6 GHz
> >> >> > with 16 GBs Memory, 5x 73 GB 15k RPM Hard drives.
> >> >> > A couple things we are looking into is the best way to partition the
> >> >> > Raid 5, what we have come up with so far is to create an OS
> >> >> > partition,
> >> >> > Backup Partition, Temp DB partition, and Everything else Partition.
> >> >> > We would like to stay with raid 5.
> >> >> > Next is there any to make Windows 2003 STD work better for SQL on a
> >> >> > fresh install?
> >> >> > SQL tips, We have read up on a few such as dedicating processor to
> >> >> > the
> >> >> > Temp DB. We use our DB for an in-house sales package (software
> >> >> > designer included), Great Plains, and a CRM program.
> >> >> > Thanks for any help.
> >> >> > Don Graham
> >> > The database size will total around 20-25GB (for now, they grow at a
> >> > rate of 7 GBs a year), as for Raid 5 we were going to go with Raid 10
> >> > but we went with the 15k drives instead. Our programmer/dbo swears by
> >> > Raid 5. We can have up to 8 drives in the box but cost was a
> >> > consideration here.
> > "But if your programmer swears by them who am I to say"
> > That was my thought as well but the more I look into it the more I
> > start to disagree. I may go for a raid 1 (OS), Raid 1 (Trans log or
> > TempDB), and I am not sure for the DB drive. Raid 10 is a little to
> > expensive.
> > Overall we have about 25-30 users, it looks like a lot of database
> > operations for the program are done with stored procedures.
Thank you all for the suggestions, I am planning on reconfiguring the
raid and going with either 2 or 3 depending on how much money I can
squeeze out. Thanks!
Don
Advice on Simple Structured Sql Query (Search)
I have created a well structured cross relationship db.. To extract all
the details out is not a problem but i am trying to now include a
simple search to filter results.. Where is the best place to build the
query, within my .Net web app or within a sp itself..
My basic setup is a table with a list of jobs (Jobs_Jobs) and fields
(JobID, Title, Keywords) and then another table that lists the
locations of the jobs(Jobs_Locations) and fields(ID,JobID,LocationID)..
What i am then trying to do is include a keyword search and a location
search together, i need to make it boolean as well and split keywords
up and then search within these to make sure they are in the
locations.. In my head it seemed fairly approchable but cant seem to
grasp it and cant find any decent tutorials.. Could you please point me
in the right direction: Do i need to be using dynamic sql', Should i
be doing most of the work within .net
A typical search would be for:
Keywords: IT,Graduate
Within Location: 12,35,48
I can do one or the other but not combined.. I also dont know how to
split up the keywords to make them two seperate keywords..
If anyone can point me in the right direction as this is my last
hurdle.. On this project at least :)Have a look at
http://www.sommarskog.se/dyn-search.html and
http://www.sommarskog.se/arrays-in-sql.html
Roji. P. Thomas
Net Asset Management
http://toponewithties.blogspot.com
"ponyoo" <anthonykallay@.hotmail.com> wrote in message
news:1133857887.366250.221060@.g14g2000cwa.googlegroups.com...
> Hi All,
> I have created a well structured cross relationship db.. To extract all
> the details out is not a problem but i am trying to now include a
> simple search to filter results.. Where is the best place to build the
> query, within my .Net web app or within a sp itself..
> My basic setup is a table with a list of jobs (Jobs_Jobs) and fields
> (JobID, Title, Keywords) and then another table that lists the
> locations of the jobs(Jobs_Locations) and fields(ID,JobID,LocationID)..
> What i am then trying to do is include a keyword search and a location
> search together, i need to make it boolean as well and split keywords
> up and then search within these to make sure they are in the
> locations.. In my head it seemed fairly approchable but cant seem to
> grasp it and cant find any decent tutorials.. Could you please point me
> in the right direction: Do i need to be using dynamic sql', Should i
> be doing most of the work within .net
> A typical search would be for:
> Keywords: IT,Graduate
> Within Location: 12,35,48
> I can do one or the other but not combined.. I also dont know how to
> split up the keywords to make them two seperate keywords..
> If anyone can point me in the right direction as this is my last
> hurdle.. On this project at least :)
>
Advice on security model for XML Web Services for many users in Active Directory role
I am working on the security model for an application that will be used by 100s of users with a dedicated SQL 2005 database for this application and access via SQL XML Web Services.
The client has asked to make it "open" during alpha testing such that anyone can access the web services without having to set them up first. Is there a way to do this? The best I can figure is to use mixed mode security and hard code a login and password. Any method using Windows authentication would require that I add every user at a minimum to the database.
In production, all users will have an active directory role specified that determines if they should have access to the web services or not. However, it is my understanding that to use Windows authentication, I would still need to add each individual user at a minimum as a Login to the SQL Server, and under best practices also as database users with permissions granted to the endpoint.
Am I correct in the above, or is there a more efficient way to achieve these results?
Thanks
-L
Your post seems to have been moved to this forum, as I have not seen it before. Could you please let me know where you posted this originally?
If the individual users are all belonging to a Windows group, you could just grant connection permissions to that group. But I am not familiar with XML Web Services, so I cannot say whether this is the best course of action.
Have you checked the following link?
http://msdn2.microsoft.com/en-us/library/ms191274.aspx
I'd suggest to also post in the XML forum: SQL Server XML
Thanks
Laurentiu