Thursday, March 22, 2012
Billing users
There aren't charge back mechanisms built in to SQL Server as you know.
You'll need to do the work based on sampling of some kind and come up with a
formula that you think is decent for your needs.
Take a look at the columns in master..sysprocesses and see what's of
interest to bill by.
Some people I've chatted with bill primarily based on IO and IO is easy to
track on a file level by using fn_virtualfilestats.
You would think that tracking by IO is not representative. But in many ways,
disk is the most expensive part of most server configurations and it's easy
to track on a pretty reliable way with the above function...
Brian Moran
Principal Mentor
Solid Quality Learning
SQL Server MVP
http://www.solidqualitylearning.com
"Bamyz" <anonymous@.discussions.microsoft.com> wrote in message
news:D6BBBA2F-0274-40CB-BF9B-5EB4667C376D@.microsoft.com...
> We have a mssql hotel with our clients databases of various sizes. Our
problem is our to bill these clients in a fair way to cover the total cost
of maintaining the database server. I will appreciate any suggestion. Thanks
in advance!
|||Thanks very much Brian and have a happy easter!
Billing users
You'll need to do the work based on sampling of some kind and come up with a
formula that you think is decent for your needs.
Take a look at the columns in master..sysprocesses and see what's of
interest to bill by.
Some people I've chatted with bill primarily based on IO and IO is easy to
track on a file level by using fn_virtualfilestats.
You would think that tracking by IO is not representative. But in many ways,
disk is the most expensive part of most server configurations and it's easy
to track on a pretty reliable way with the above function...
--
Brian Moran
Principal Mentor
Solid Quality Learning
SQL Server MVP
http://www.solidqualitylearning.com
"Bamyz" <anonymous@.discussions.microsoft.com> wrote in message
news:D6BBBA2F-0274-40CB-BF9B-5EB4667C376D@.microsoft.com...
> We have a mssql hotel with our clients databases of various sizes. Our
problem is our to bill these clients in a fair way to cover the total cost
of maintaining the database server. I will appreciate any suggestion. Thanks
in advance!|||Thanks very much Brian and have a happy easter!
Billing users
em is our to bill these clients in a fair way to cover the total cost of mai
ntaining the database server. I will appreciate any suggestion. Thanks in ad
vance!There aren't charge back mechanisms built in to SQL Server as you know.
You'll need to do the work based on sampling of some kind and come up with a
formula that you think is decent for your needs.
Take a look at the columns in master..sysprocesses and see what's of
interest to bill by.
Some people I've chatted with bill primarily based on IO and IO is easy to
track on a file level by using fn_virtualfilestats.
You would think that tracking by IO is not representative. But in many ways,
disk is the most expensive part of most server configurations and it's easy
to track on a pretty reliable way with the above function...
Brian Moran
Principal Mentor
Solid Quality Learning
SQL Server MVP
http://www.solidqualitylearning.com
"Bamyz" <anonymous@.discussions.microsoft.com> wrote in message
news:D6BBBA2F-0274-40CB-BF9B-5EB4667C376D@.microsoft.com...
> We have a mssql hotel with our clients databases of various sizes. Our
problem is our to bill these clients in a fair way to cover the total cost
of maintaining the database server. I will appreciate any suggestion. Thanks
in advance!|||Thanks very much Brian and have a happy easter!
Monday, March 19, 2012
Big Database
My dabase has aproximately 45 GB and in the last weeks MSSQL started to
consume all the resources, basically all the RAM of the server. My server
has 8 GB of RAM. It keep consuming more and more ram memory without release
the RAM. It get to the point that I must reboot the server, sometimes with a
lot of users connected to it.
I have Windows 2000 Server and my MSSQL is a 2000 Standard Edition 8.00.194
RTM.
Before my server was very fast. I don't understand what is happening here.
I will appreciate your comments.
RRafael,
First question you are using SQL 2000 RTM? Why are you not on SP 3 or SP 4?
There are many bugs fixed between RTM and SP 3 and SP 4. One of these could
be the issue.
Second, is this a single instance of SQL 2000?
SQL 2000 standard can only address 2 GB. If you want to be able to address
more RAM in SQL 2000 you will need to upgrade to the Enterprise Edition.
Then you will need to enable AWE, read BOL: Using AWE Memory on Windows
2000.
If you were running multiple instances of Standard then they each can
address 2 GB of RAM.
Third, you can allow SQL to dynamically control memory or you can set it. If
you use AWE to use more than 2 GB of RAM you will have to manually set it.
As your short term fix, you could try manually setting the amount of RAM for
SQL Server at 2 GB. Then I would load up SP 3 if not SP 4 as soon as
possible, don't forget to try it in your test environment first to make
certain that it does not break anything else. Then I would consider
Enterprise Edition so that I could actually take advantage of all of the
RAM!
David Lundell
Principal Consultant and Trainer
www.MutuallyBeneficial.com
David@.MutuallyBeneficial.com
"Rafael Tejera" <rafaeltejera@.hotmail.com> wrote in message
news:%23tZbWtAgGHA.5088@.TK2MSFTNGP02.phx.gbl...
>I need Help!
> My dabase has aproximately 45 GB and in the last weeks MSSQL started to
> consume all the resources, basically all the RAM of the server. My server
> has 8 GB of RAM. It keep consuming more and more ram memory without
> release the RAM. It get to the point that I must reboot the server,
> sometimes with a lot of users connected to it.
> I have Windows 2000 Server and my MSSQL is a 2000 Standard Edition
> 8.00.194 RTM.
> Before my server was very fast. I don't understand what is happening here.
> I will appreciate your comments.
>
> R
>
>
Big Database
My dabase has aproximately 45 GB and in the last weeks MSSQL started to
consume all the resources, basically all the RAM of the server. My server
has 8 GB of RAM. It keep consuming more and more ram memory without release
the RAM. It get to the point that I must reboot the server, sometimes with a
lot of users connected to it.
I have Windows 2000 Server and my MSSQL is a 2000 Standard Edition 8.00.194
RTM.
Before my server was very fast. I don't understand what is happening here.
I will appreciate your comments.
RRafael,
First question you are using SQL 2000 RTM? Why are you not on SP 3 or SP 4?
There are many bugs fixed between RTM and SP 3 and SP 4. One of these could
be the issue.
Second, is this a single instance of SQL 2000?
SQL 2000 standard can only address 2 GB. If you want to be able to address
more RAM in SQL 2000 you will need to upgrade to the Enterprise Edition.
Then you will need to enable AWE, read BOL: Using AWE Memory on Windows
2000.
If you were running multiple instances of Standard then they each can
address 2 GB of RAM.
Third, you can allow SQL to dynamically control memory or you can set it. If
you use AWE to use more than 2 GB of RAM you will have to manually set it.
As your short term fix, you could try manually setting the amount of RAM for
SQL Server at 2 GB. Then I would load up SP 3 if not SP 4 as soon as
possible, don't forget to try it in your test environment first to make
certain that it does not break anything else. Then I would consider
Enterprise Edition so that I could actually take advantage of all of the
RAM!
David Lundell
Principal Consultant and Trainer
www.MutuallyBeneficial.com
David@.MutuallyBeneficial.com
"Rafael Tejera" <rafaeltejera@.hotmail.com> wrote in message
news:%23tZbWtAgGHA.5088@.TK2MSFTNGP02.phx.gbl...
>I need Help!
> My dabase has aproximately 45 GB and in the last weeks MSSQL started to
> consume all the resources, basically all the RAM of the server. My server
> has 8 GB of RAM. It keep consuming more and more ram memory without
> release the RAM. It get to the point that I must reboot the server,
> sometimes with a lot of users connected to it.
> I have Windows 2000 Server and my MSSQL is a 2000 Standard Edition
> 8.00.194 RTM.
> Before my server was very fast. I don't understand what is happening here.
> I will appreciate your comments.
>
> R
>
>
Wednesday, March 7, 2012
BETWEEN syntax at SQL
I would like to know how MSSQL handles dates for BETWEEN syntax at SQL statements.
e.g. SELECT * FROM [relation] WHERE [date] BETWEEN '2003/01/01' AND '2003/12/31'
I find that the result rows do not include ones with [date]='2003/12/31'
So, now I'm using BETWEEN '2003/01/01' AND '2004/01/01' instead.
Is it a standard way to perform this kind of task?between ... and ... is equal >= and <=
So I think u can not get the data that date column value is bigger than 2003/12/31 00:00:00
SELECT * FROM [relation] WHERE [date] BETWEEN '2003/01/01' AND '2003/12/31'
must change to ==>
SELECT * FROM [relation] WHERE [date] BETWEEN '2003/01/01' AND dateadd(day,1,'2003/12/31')|||enhydraboy is right with the date time of '2003/12/31 00:00:00'
This is where your between will have a problem when comparing
'2003/12/31' against lets say '2003/12/31 12:45:30'
some times I just force it to '2003/12/31 23:59:59'
when I use date and time : )
Hope this helps|||Originally posted by TrueCodePoet
enhydraboy is right with the date time of '2003/12/31 00:00:00'
This is where your between will have a problem when comparing
'2003/12/31' against lets say '2003/12/31 12:45:30'
some times I just force it to '2003/12/31 23:59:59'
when I use date and time : )
Hope this helps
Well ...
The standard i would use is
SELECT * FROM [sysobjects] WHERE convert(datetime,convert(varchar(10),[crdate],121)) BETWEEN '2003/01/01' AND '2003/12/31'|||Originally posted by Enigma
Well ...
The standard i would use is
SELECT * FROM [sysobjects] WHERE convert(datetime,convert(varchar(10),[crdate],121)) BETWEEN '2003/01/01' AND '2003/12/31'
That is, quite frankly, bonkers. You are forcing a column conversion on every row in the table.
Would it not make a more sargeable filter to convert the between varchars to the date format required? It happens once in the excution of the query and applies to all rows with no further conversion.
And if he wants to include all of the last day of the month, it's
BETWEEN '1 Jan 2004' AND '1 Feb 2004'|||Originally posted by HanafiH
That is, quite frankly, bonkers. You are forcing a column conversion on every row in the table.
Would it not make a more sargeable filter to convert the between varchars to the date format required? It happens once in the excution of the query and applies to all rows with no further conversion.
And if he wants to include all of the last day of the month, it's
BETWEEN '1 Jan 2004' AND '1 Feb 2004'
Never did I think of it that way ... and believe me .. I have been using it like this for past two years ... thanks for correcting me ... you have been a great help :)
Well .. you learn at least one new thing on this site everyday|||Writing International Transact-SQL Statements (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/acdata/ac_8_qd_14_3unn.asp)
A possible solution to this is to use the ISO Standard format for sending the datetime data to SQL Server, which is "YYYYMMDD" (no separators). Using the ISO format is more "international," and is independent of the default language. For more information, see the CONVERT function in the SQL Server Books Online.|||It makes no difference what format the datetime value is sent in. It does make a difference whether the datetime value includes a time portion or not. Many applications cannot restrict themselves to whole date values, and thus some sort of conversion or adjustment is necessary to include all events occuring on the last day.|||Originally posted by buser
A possible solution to this is to use the ISO Standard format for sending the datetime data to SQL Server, which is "YYYYMMDD" (no separators). excellent advice
one minor point: ISO standard does include separators
see Numeric representation of Dates and Time (http://www.iso.ch/iso/en/prods-services/popstds/datesandtime.html)|||Sorry.. I might have been confusing .. I will just post what I usualy do.
SELECT * FROM [sysobjects] WHERE [crdate]
BETWEEN
convert(datetime,'2003/01/01 00:00:00',120)
AND
convert(datetime,'2003/12/31 23:59:59',120)
the two functions should only be run once durring the compile
: )
I have not noticed much difference with this query on 1 mill plus records
Only reasonI don't use the 121 format is the Milleseconds is not needed for me Most of the Time I use the 101 format.
hope this helps|||SELECT * FROM [sysobjects] WHERE [crdate]
BETWEEN
convert(datetime,'2003/01/01 00:00:00',120)
AND
convert(datetime,'2003/12/31 23:59:59',120)
actually you don't have to convert them
when you put the year first like that, the database will assume that the next field is the month, etc.
SELECT * FROM [sysobjects]
WHERE [crdate]
BETWEEN '2003/01/01 00:00:00'
AND '2003/12/31 23:59:59'
Friday, February 24, 2012
Best way to take backUp
secondary server with out loosing any single Insert/update?Hi
Do you want the secondary server read only ?
1)Log shipping
2) Repliaction
"imtiaz" <Imtiaz@.microsoft.com> wrote in message
news:uioGWaxfGHA.3860@.TK2MSFTNGP02.phx.gbl...
> Which is the best way to take BackUp of the DB from MSSQL 2000 to a
> secondary server with out loosing any single Insert/update?
>|||Yes I want secondary server to be readonly/ or to a backup device is also
will work.
Can you please explain the following in detail(steps)
1.log shipping
2.replication
Thanks in advance
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:OFfRO3xfGHA.1276@.TK2MSFTNGP03.phx.gbl...
> Hi
> Do you want the secondary server read only ?
> 1)Log shipping
> 2) Repliaction
> "imtiaz" <Imtiaz@.microsoft.com> wrote in message
> news:uioGWaxfGHA.3860@.TK2MSFTNGP02.phx.gbl...
>|||Check this out
http://www.sql-server-performance.c...og_shipping.asp
I guess it would give you an good idea about Log Shipping in SQL Server.
Best Regards
Vadivel
http://vadivel.blogspot.com
"imtiaz" wrote:
> Yes I want secondary server to be readonly/ or to a backup device is also
> will work.
> Can you please explain the following in detail(steps)
> 1.log shipping
> 2.replication
> Thanks in advance
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:OFfRO3xfGHA.1276@.TK2MSFTNGP03.phx.gbl...
>
>|||http://www.sql-server-performance.c...og_shipping.asp
About replications it is very big topic , you are going to spend a lot of
time to learn it
http://www.mssqlcity.com/Articles/Replic/Replic.htm --Setting All
Replica (Step by step)
"imtiaz" <Imtiaz@.microsoft.com> wrote in message
news:OlYL4AyfGHA.1792@.TK2MSFTNGP03.phx.gbl...
> Yes I want secondary server to be readonly/ or to a backup device is also
> will work.
> Can you please explain the following in detail(steps)
> 1.log shipping
> 2.replication
> Thanks in advance
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:OFfRO3xfGHA.1276@.TK2MSFTNGP03.phx.gbl...
>
Friday, February 10, 2012
Best way to connect to a MSSQL database
Hello,
Is it better to use a DSN connection or using a connection string Set Connection = Server.CreateObject("ADODB.Connection")
Which is easier to use and more reliable?
Also could I have all the connection info on one page and then just include it with a include statment everytime I need to query the database??
Thank you,
Rich
Are you using classic ASP or ASP.NET? The first has pages ending in .asp, and the second ends with .aspx.
In either case, DSNs and ODBC are discouraged.
For Sql Server 2000, look here:http://www.connectionstrings.com/?carrier=sqlserver, and for 2005, here:http://www.connectionstrings.com/?carrier=sqlserver2005
|||
I am learning classic ASP and then will learn ASP.NET
Why are DSNs and ODBC discouraged...
I was looking at the websites you gave me.. then are all saying .NET... will classic ASP work too??
Rich
for Classic ASP i would recommend using DSN and ODBC as you can use any database with this kind of connections with smaller changes.
you can place your connection in a page called connection.asp which then you will need to inlcude at the top of each page. for sample check out this:
http://www.codeproject.com/database/connectionstrings.asp
but for ASP.NET its provides its own Provider for different database which makes its easy to control the database and are faster and more releiable then ODBC.
thanks
|||
Frankly, I would go straight to ASP.NET. It has replaced classic ASP. There's a newsgroup for classic ASP over at microsoft.public.inetserver.asp.general (which you can get to through Google Groups). There used to be thousands of posts a month there. No there are just one or two per day. Classic ASP will not be developed any further. The only reason that people generally use it these days is because they have existing apps that were written in classic ASP that they want to maintain.
ODBC is deprecated technology. DSNs make use of ODBC. They cause unnecessary overhead and maintenance. For classic ASP, you should use OLEDB.
http://databases.aspfaq.com/database/what-should-my-connection-string-look-like.html