Monday, March 26, 2012
Number of statements during a specific time
I'd like to see how many queries are launched in a hour in a live server. In
order to achieve such information I've though in to open profiler applicatio
n
and then save that information on a .TRC file (encompassing two hours for
example). After that, by DTS export that file to a table and to retrieve the
number of SELECT commited with the help of specific strings (Textdata and
loginname). That will mean know the number of queries launched for our
developers from its QA sessions as well as queries and another things for an
y
kind of processes (If I am not wrong)
It take part of a set of measures intended to demonstrate that we'd need
news hardware requirements, hd, and so on.
Any help/though/advice of how do this better? In aid of faster or reliabilit
y.
Thanks a lot for your input,It is not a good solution due to I've got now 140mb of tracefile for just a
hour!!
Let me know any idea...
"Enric" wrote:
> Dear fellows,
> I'd like to see how many queries are launched in a hour in a live server.
In
> order to achieve such information I've though in to open profiler applicat
ion
> and then save that information on a .TRC file (encompassing two hours for
> example). After that, by DTS export that file to a table and to retrieve t
he
> number of SELECT commited with the help of specific strings (Textdata and
> loginname). That will mean know the number of queries launched for our
> developers from its QA sessions as well as queries and another things for
any
> kind of processes (If I am not wrong)
> It take part of a set of measures intended to demonstrate that we'd need
> news hardware requirements, hd, and so on.
> Any help/though/advice of how do this better? In aid of faster or reliabil
ity.
> Thanks a lot for your input,|||try use performans counters - perfmon (sqlserver:sqlserverstatistics)
but... is is not idealy metod to demonstrate that you need new hardware...
--
Aleksandar Grbic
MCDBA, Senior Database Administrator
"Enric" wrote:
> Dear fellows,
> I'd like to see how many queries are launched in a hour in a live server.
In
> order to achieve such information I've though in to open profiler applicat
ion
> and then save that information on a .TRC file (encompassing two hours for
> example). After that, by DTS export that file to a table and to retrieve t
he
> number of SELECT commited with the help of specific strings (Textdata and
> loginname). That will mean know the number of queries launched for our
> developers from its QA sessions as well as queries and another things for
any
> kind of processes (If I am not wrong)
> It take part of a set of measures intended to demonstrate that we'd need
> news hardware requirements, hd, and so on.
> Any help/though/advice of how do this better? In aid of faster or reliabil
ity.
> Thanks a lot for your input,
Monday, March 12, 2012
Number are displayed in the wrong format
Hi
I'm not sure if this is a .net or a SQL issue. My development machine is using SQL 2005 while the live server is SQL2000. I have a smallmoney field in the database for holding a house rent. The following is used to display the contents on the page
<asp:Label ID="lblrent" runat="server" Text='<%# Bind("rent", "(0:0.00)") %>'></asp:Label
In development, the number is displayed correctly, with the decimal place, .e.g. 200.50 but on the live server the number is displayed as 20050,00.
What I have noticed in the database is that the number is held differently
SQL 2005 - 200.5000
SQL 2000 - 20050
Is there a difference between SQL 2000 and 2005? How do I get around this problem?
Many thanks
Try using this as your formatting string. I'm not sure what would cause that problem.
{0:c}
I hope that helps,
Brendan
oops sorry do both of them list the same datatype for the column? It should be money or smallmoney for both of them. If it is not it might still have let you insert the value and now would be giving an incorrect result.
My guess would be that one of your servers is set to a culture that you aren't expecting. My guess would be the production webserver is set to a culture that uses "," as the decimal separator, and "." as the thousands separator (Considering that it printed the number 20050 as 20050,00).
|||The datatype for the columns in both databases is smallmoney, which is why I'm a bit confused as to why they are being displayed differently. Even if I manually change the entry in the SQL2000 db to a number with a decimal place, the decimal place is removed.
I tried using {0:C} as the formatstring and what I get back is 20.050,00 € on the server with SQL2000. With SQL2005 I get £200.50.
The server where the website hosted is with 1and1 using a MS Business PRO package, so I don't really have a lot of control over the SQL config. I have e-mailed tech support asking for some more information on the default settings for the SQL setup.
If I am using the same code and the same formatstring, the problem must be with the database setup. Right?
|||
No.
Put this in your web.config somewhere in the <system.web> tags:
<globalizationculture="en-US"uiCulture="en-US"/>
Now the SQL2000 server should show $20,500.00 and the SQL2005 server should show $200.50.
How did you get the data from one server to the other? Because whatever process you used also had culture problems, and the data didn't get moved correctly.
|||Thanks. That solved the problem. I changed it to en-GB, as this is a UK site and I need the £ symbol displayed. The numbers are being displayed correctly.
Only the table structure was imported to the server. No data was imported for the table with the money columns. The users are entering the data themselves.
I exported the table structure using the SQL Database Publishing Wizard. I changed the option 'script for server version' to SQL Server 2000 and left the other options at default. Should I have changed any of the other options?