Showing posts with label available. Show all posts
Showing posts with label available. Show all posts

Wednesday, March 21, 2012

Help needed?

Hi

I'm a newbie to SQL server..... l'm building a website where companies can save important data. I have a SQL server available but I'm not sure how to store the data. Should I create a new database for every user or should I store everything in the same database and then use a UserId to recognize the data and the user?

The data stored for each user are stored in tables which are exactly the same so all tables could be gathered into one table and then a UserId could tell which records belong to whom.

Hope my english isn't too bad..otherwise just ask me questions and I'll get back A.S.A.P.

Regards

Joachim

1 database will support many users. As you suggested, you would create a user table and each user would have an entry there. The primary key of that table (e.g. : UserId) would be used as a Foreign Key in other tables to identify which user owns the data. e.g. : an orders table would have a userId column to specify which user the order belonged to.

Hope this helps.

|||

hi joachim,

thats not a bad english at all.

regarding your question i suggest you take your time

studying the basic database concept such

normalization, entity integrity, domain integrity, relational integrity and bussiness integrity.

its not easy at first but it will help very much in the long run of your database career

regards

joey

Friday, March 9, 2012

Help needed about databases!

Hi

I'm a newbie to SQL server.... l'm building a website where companies can save important data. I have a SQL server available but I'm not sure how to store the data. Should I create a new database for every user or should I store everything in the same database and then use a UserId to recognize the data and the user? What about the case where I reaches let's say 1000 users in the one user per database case, it would be extremly difficult to have an overview of the databases or what?

The data stored for each user are stored in tables which are exactly the same so all tables could be gathered into one table and then a UserId could tell which records belong to whom.

Hope my english isn't too bad..otherwise just ask me questions and I'll get back A.S.A.P.

Regards

Joachim

You probably should just use a single database. Unless there are overriding issues like you distribute the database to the company. Then you wouldn't want one company to get another companies data. I'm assuming there is a single application where all the companies log in to the same site. If each company has separate sites, then you might actually need separate apps (and databases) for each.

Single app / db is easier to maintain but realize that changes for one then apply to all.

HTH.