Showing posts with label machine. Show all posts
Showing posts with label machine. Show all posts

Wednesday, March 21, 2012

number of databases in sql server 2005

Hello,

If I have a database of 5 GB with only 20 tables in it, how many of
those can we put in how many database servers on a high end machine
(Dual Xeon 8 GB on windows 2003)?
It is to maka a quotation and an estimation of the cost.

TIA

Mariosledge (Witdoek@.gmail.com) writes:

Quote:

Originally Posted by

If I have a database of 5 GB with only 20 tables in it, how many of
those can we put in how many database servers on a high end machine
(Dual Xeon 8 GB on windows 2003)?
It is to maka a quotation and an estimation of the cost.


The lowest of 32762 and (the available disk space/5GB).

If you mean the practical limit, before the machine suffocates under the
load, that's impossible to answer, without knowing the traffic per
database.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

Number of connections in XP Pro

We are planning multiple remote sites, each running 5 XP Pro or XP Embedded
which will logon to a Windows Server 2003 machine at Head Office via a WAN.
Each XP machine in the site will be replicating its single db to the 4
others via Merge Replication. We will also be using MSMQ 3 for
communication between 2 computers in any site.
I am unsure of how replication (and MSMQ) affects the 10 connections limit
of XP Pro. In replication, would there only be 1 incoming connection on
each machine? (i.e. The Publisher)
I bump into this limit all the time when running pro. The short answer is
you need to bypass this by using SQL Authentication and use a pull
subscription with FTP.
You may have to disable MSMQ, reboot, then ensure that the first thing you
do when you come up is download the snapshot. Then start up MSMQ.
After the snapshot is deployed you shouldn't have to use NT authentication
any more. You should be good from there.
"Chris" <chris.spamhater@.ihatespam.co.uk> wrote in message
news:OSXzqUPXEHA.1764@.TK2MSFTNGP10.phx.gbl...
> We are planning multiple remote sites, each running 5 XP Pro or XP
Embedded
> which will logon to a Windows Server 2003 machine at Head Office via a
WAN.
> Each XP machine in the site will be replicating its single db to the 4
> others via Merge Replication. We will also be using MSMQ 3 for
> communication between 2 computers in any site.
> I am unsure of how replication (and MSMQ) affects the 10 connections limit
> of XP Pro. In replication, would there only be 1 incoming connection on
> each machine? (i.e. The Publisher)
>
>

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?

Saturday, February 25, 2012

NULL SQL 2000

Maybe I'm doing something weird... but here's the problem I'm having.

I made a small ASP.NET (C#) site on my local machine that connects to SQL 2000. When I test the application it runs great. Everything gets stored into the database and the tables that it is suppose to.

I upload the site to a hosting company and when I run it, I get all sorts of error with the database. (I also copied the database from my local machine to the server via Enterprise Manager.)

For example, when I run the registration page - I get the error message:

"Cannot insert the value NULL into column 'user_id', table 'xxx.xxxx.tbl_users'; column does not allow nulls. INSERT fails. The statement has been terminated. "

I checked the table properties and my columns are set to allow null values. With the exception of having a primary key set to a column for indentity purpose (user_id).

The weird part is that I checked to see if the data are being stored into the column... and it is! Everything that was sent from the form is being stored into the table.

So I don't understand the problem I am having. Can anyone shed some light for me?

Below is the function I've written that inserts the data into the table.

===========================
C# Function to insert data
===========================

// Store Data to String

string strFirst = reg_fname.Text.ToString().Trim();
string strLast = reg_lname.Text.ToString().Trim();
string strEmail = reg_email.Text.ToString().Trim();
string strZip = reg_zip.Text.ToString().Trim();
string strCountry = reg_country.Text.ToString().Trim();

// Open Connection to Database

string strConnection = ConfigurationSettings.AppSettings["xxxxx"];

string strSQL = "INSERT INTO tbl_registration (first_name, last_name, email, zip, country) VALUES ('"+ strFirst.Replace("'", "") +"', '"+ strLast.Replace("'", "") +"', '"+ strEmail.Replace("'", "") +"', '"+ strPassword.Replace("'", "") +"', '"+ strZip.Replace("'", "") +"', '"+ strCountry.Replace("'", "") +"')";

// Execute Connection and INSERT Data

SqlConnection oConnection = new SqlConnection(strConnection);
oConnection.Open();
SqlCommand oCommand = new SqlCommand(strSQL, oConnection )oCommand.ExecuteNonQuery();

oConnection.Close();How is the user_id column populated? You mentioned "identity purposes." Is the column marked as an IDENTITY in SQL?

Regarding your command, consider using parameterized commands:


string sqlStmt;
SqlCommand cmd;

sqlStmt = "INSERT INTO (first_name, last_name, email, zip, country) VALUES (@.first_name, @.last_name, @.email, @.zip, @.country)";
cmd = new SqlCommand(sqlStmt, oConnection);
cmd.Parameters.Add("@.first_name", strFirst);
cmd.Parameters.Add("@.last_name", strLast);
cmd.Parameters.Add("@.email", strPassword);
cmd.Parameters.Add("@.zip", strZip);
cmd.Parameters.Add("@.country", strCountry);
cmd.ExecuteNonQuery();

Note that if any of the parameters contain any illegal characters, such as a single quote, the parameter will be "fixed", so the str.Replace("''", "'") is not required.|||Also, are there triggers involved? Sometimes, the error message is referring to something that your trigger was trying to do, and not the proc you were explicitly executing... :)