Showing posts with label company. Show all posts
Showing posts with label company. Show all posts

Tuesday, March 27, 2012

Advice on Database structure

I am thinking of doing a fake PC company site for my ASP project. sowhat they will have is a chat, products with reviews, and users canhave "Buddies".

So my DB so far (Tables):

ProductPC - ID, Processor, RAM, HDD, Graphics, LCD ...ProductHardware- ID, Title (Like "Intel C2D E6600"), Description, Price, Rating (0-5stars, so integer), Category (CPU, HDD, Graphics)ProductSoftware - ID, Title (eg. "Adobe CS3"), Description, Price, Rating, Category (eg. Design, Programming)Reviews - ID, ProductID, Title, Content, DateChat - ID, TopicID, Title, Content, DateUsers - ID, Username, Password,
The problem, how do i connect Reviews to the products since they are from diff tables.
How do i get the "buddy" system working
Chat i think its not as simple as that

But i just need a simple ASP project, so no need to get too complex, but i still hope to learn as much.

Concerning

ProductPC - ID, Processor, RAM, HDD, Graphics, LCD ...ProductHardware - ID, Title (Like "Intel C2D E6600"), Description, Price, Rating (0-5 stars, so integer), Category (CPU, HDD, Graphics)ProductSoftware - ID, Title (eg. "Adobe CS3"), Description, Price, Rating, Category (eg. Design, Programming)Reviews - ID, ProductID, Title, Content, Date
you have a problem since Review.ProductId can refere to 1 of 3 tables. To overcome this, I suggest you create a ProductTable thus:
Product - Id, Cost, Title, IsPC, IsHardware, IsSoftware
Change the Id column on ProductPc, ProductHardware and ProductSoftware tables to be non-identity. When a Product entry is created, one and only of the Is must be true. The appropriate record of ProductPc, ProductHardware or ProductSoftware can be created using the the New Product.Id and the Id value. This will allow your review table to work.|||

sorry... but what do u mean? taking off my IDs? then when i add to DB how should i add?

|||ProductPC - ID, Processor, RAM, HDD, Graphics, LCD ...ProductHardware - ID, Title (Like "Intel C2D E6600"), Description, Price, Rating (0-5 stars, so integer), Category (CPU, HDD, Graphics)ProductSoftware - ID, Title (eg. "Adobe CS3"), Description, Price, Rating, Category (eg. Design, Programming)Reviews - ID, ProductID, Title, Content, Date|||

Thanks. i am getting you. but the problem id how do i acheive the part of having the ID to be unique, do i need to code that? because now i have set those IDs to identity and auto increment. if they are not identity, then how do they be unique (automatically)? and to have product ID to be unique across 3 tables?

|||

The sequence for creating a new record is:

Create the new product reference

|||

mmm... Scope_Identity() is something unfamiliar to me right now i will search abt it later. for now i am going off to school.

|||

is it ok if i have 1 Reviews Table with the ProductID linking to 3 Tables? PC, Hardware & Software Table

So,

PK : Reviews.ProdID - FK: ProdPC.PCID
PK : Reviews.ProdID - FK: ProdHW.HWID
PK : Reviews.ProdID - FK: ProdSW.SWID

|||

No the link is:

PK : Reviews.ProdID - FK: Product.Id
PK : Reviews.ProdID - FK: Product.Id
PK : Reviews.ProdID - FK: Product.Id

This is because
PK: ProdPC.PCID - FK Product.Id
PK: ProdHW.HWI - FK Product.Id
PK: ProdSW.SWID- FK Product.Id

|||

i think u say that because u think i used Scope_Identity()? for now i dunno how to use that. so what i done is 1 Reviews Table linking to 3 Products Table (1 for PC, HW & SW) so Reviews.ProdID to ProdXX.ID. is that also ok?

|||

Here is a SQL2005 script with some of the tables and a stored procedure for inserting a record showing how to use Scope_Identity()
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ProductSoftware]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[ProductSoftware](
[Id] [int] NOT NULL,
[Category] [nvarchar](50) NOT NULL,
[Description] [nvarchar](250) NOT NULL,
[Rating] [nvarchar](50) NOT NULL,
CONSTRAINT [PK_ProductSoftware] PRIMARY KEY CLUSTERED
([Id] ASC)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]) ON [PRIMARY]
END
GO
EXEC sys.sp_addextendedproperty @.name=N'MS_Description', @.value=N'Non-identity primary key from Product.Id' ,@.level0type=N'SCHEMA', @.level0name=N'dbo', @.level1type=N'TABLE', @.level1name=N'ProductSoftware', @.level2type=N'COLUMN', @.level2name=N'Id'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Product]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Product](
[Id] [int] IDENTITY(1,1) NOT NULL,
[Name] [nvarchar](250) NOT NULL,
[Price] [money] NOT NULL,
CONSTRAINT [PK_Product] PRIMARY KEY CLUSTERED
([Id] ASC)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]) ON [PRIMARY]
END
GO
EXEC sys.sp_addextendedproperty @.name=N'MS_Description', @.value=N'a.k.a. Title' ,@.level0type=N'SCHEMA', @.level0name=N'dbo', @.level1type=N'TABLE', @.level1name=N'Product', @.level2type=N'COLUMN', @.level2name=N'Name'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ProductHardware]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[ProductHardware](
[Id] [int] NOT NULL,
[Description] [varchar](max) NOT NULL,
CONSTRAINT [PK_ProductHardware] PRIMARY KEY CLUSTERED
([Id] ASC)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]) ON [PRIMARY]
END
GO
EXEC sys.sp_addextendedproperty @.name=N'MS_Description', @.value=N'Non-identity product key from Product.Id' ,@.level0type=N'SCHEMA', @.level0name=N'dbo', @.level1type=N'TABLE', @.level1name=N'ProductHardware', @.level2type=N'COLUMN', @.level2name=N'Id'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ProductPc]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[ProductPc](
[Id] [int] NOT NULL,
[Graphics] [nvarchar](50) NOT NULL,
[HDD] [nvarchar](50) NOT NULL,
[LCD] [nvarchar](50) NOT NULL,
[Processor] [nvarchar](50) NOT NULL,
[RAM] [nvarchar](50) NOT NULL,
CONSTRAINT [PK_ProductPc] PRIMARY KEY CLUSTERED
([Id] ASC)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]) ON [PRIMARY]
END
GO
EXEC sys.sp_addextendedproperty @.name=N'MS_Description', @.value=N'Non-identity primary key from Product.Id' ,@.level0type=N'SCHEMA', @.level0name=N'dbo', @.level1type=N'TABLE', @.level1name=N'ProductPc', @.level2type=N'COLUMN', @.level2name=N'Id'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Review]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Review](
[Id] [int] NOT NULL,
[ProductId] [int] NOT NULL,
[ContentText] [nvarchar](max) NULL,
[Title] [nvarchar](50) NOT NULL,
[DateAdded] [datetime] NOT NULL CONSTRAINT [DF_Review_DateAdded] DEFAULT (getdate()),
CONSTRAINT [PK_Review] PRIMARY KEY CLUSTERED
([Id] ASC) WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[usp_ProductHardware_Insert]')
AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @.statement = N'CREATE PROCEDURE [dbo].[usp_ProductHardware_Insert]
(
@.Description varchar (MAX),
@.Name nvarchar (250),
@.Price money,
@.RETURN INT OUTPUT,
@.IDENTITY INT OUTPUT
) AS
-- Purpose:
-- Insert record into Product and ProductHardware table
-- History:
-- 11Jun2007 CVC Original coding
SET NOCOUNT ON
INSERT INTO Product(Name, Price) VALUES (@.Name, @.Price)
SELECT @.IDENTITY = SCOPE_IDENTITY()
INSERT INTO ProductHardware(Id, Description)
VALUES ( @.IDENTITY, @.Description)
SELECT @.RETURN = @.@.error
RETURN
----- this is the end ------
'
END|||

i think i will need more knowledge about Stored Procedures and Scope Identity. any tutorials about that?

|||

There are some good stored procedure tutorials at

http://www.codeproject.com/database/hkstoredproc.asp (Everything you wanted to know about Stored Procedures)

Advice on a good strategy

I have a general question and a specific question.

1.) I'm doing some reporting using the Crystal Reports software my company has installed; however, I see threads of people using all kinds of more powerful software (VB, C, etc) to work with Crystal (web development, etc). Crystal Reports is on a terminal server here, and my audience will use that software to view the reports. Am I then limited to the Crystal (or Basic) syntax found in the software, or can I somehow use something like Perl or C to do my programming? I'm not sure how all of this goes together.

2.) More specifically, I'm trying to build a parts list tree (parent/child). The database is organized such that it makes this correlation difficult. In one Table (Part Master), is a list of all unique parts. In another table is a list of all unique jobs (times we've made the parts) (Jobs) that would show the part being made (one part shown) (link to Part Master). In the third table (Materials), the Jobs are listed with all of the sub components used for the main part for that job. Here, I'd want to capture the sub-components, but then loop back through the original Part Master to capture THEIR subcomponets, and so on. There could be up to 5 levels of this.

Basically, I want a user to enter a top-level assembly number, then I want to show every part used for that assembly, all the way down. My problem is that I really need to loop through the original list of returned records (I think). If I find the first part, and the first level of sub-parts, I may have passed those records already, so I need to re-read the list. I attempted build an array of the entire list of parts and do the logic at the end, but there are 82,000 of them (limit is 1000 and I don't plan to do Case with 82 levels). I'm inclined to believe that Crystal Reports (v.10) does not support multi-dimensional arrays, making this even tricker.

Can someone help me on a strategy to attack this one?Well, first you probably need to realize, that even if they are using VB or C-whatever or anything else in conjunction with Crystal, that Crystal is still a data-analysis/reporting engine. All it does is spit out the data in whatever format you design the report to do so. You can connect directly to your database (I am guessing it is a relatively standard engine, although you don't mention it), and then use crystal to select certain sets of data, group that data, and summarize that data, no matter what the general GUI interface to your data is. So just use crystal, point it to your database through ODBC or OLEDB (or whichever method you want), and go. Now, how you allow your users to view those reports is another matter, you might put shortcuts on the desktop (if the full version of CR is accessible through the terminal server), or use or develop a CR viewer for them to open the reports in. For that, you would need another tool, such as VB or C-whatever.

It does sound as if you have several layers of one-to many relationships to account for in the description of your project. My presonal experience leads me to usually start for the smallest partion, and work up. If you want a jobs report, that will show the detail down to the smallest sub-part, you would probably know that you need to start from an AssembyID, display each individual part, and below each part, a list of sub-parts. So you would add each of those tables to your report and link them by their primary keys (I usually use a left join if there is any possibility of missing links, i.e., a sub-part entry that is not in the table, otherwise an inner join would be more efficient). Then group by jobid, partid, and sub-part id. Add all the fields you want for each job (be sure to keep the field boxes in the correct group).

Obviously, this is hugely simplified and requires a lot more, but that is a basic approach. More detail could be given, if you give me a list of tables and their relationships.

ScottJ

Sunday, March 25, 2012

Advice needed - how to build skills as a MS database administrator

Would appreciate some advice for a small/mid company IT MCSE that is now
required to pick up MCDBA skills (with a training budget that limits me to
Barnes&Noble).
Our environment has an SQL 2000 on our ERP server; both will be upgraded in
November, where we will have SQL 2005.
I've scanned over free technet documentation, and subscribed to newsletters
- but could use a bit more direction.
I'd be interested in an SQL guru's advice on how I could ramp up my skill
quickly - to at least maintain an existing SQL database with an app server.
High quality books (they don't need to start at ground zero, I am a
proficient SQL writer already), and quality websites, would be greatly
appreciated. I'm looking for materials that will show me how to provide
proper maintenace and optimize performance of an SQL server.
Thanks in advance,
--
pbrill1You might find something useful here.
http://msdn2.microsoft.com/en-us/virtuallabs/aa740409.aspx
http://www.microsoft.com/learning/assessment/ind/windowsserver/default.mspx#EWD
Regards,
Dave Patrick ...Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect
"pbrill1" wrote:
> Would appreciate some advice for a small/mid company IT MCSE that is now
> required to pick up MCDBA skills (with a training budget that limits me to
> Barnes&Noble).
> Our environment has an SQL 2000 on our ERP server; both will be upgraded
> in
> November, where we will have SQL 2005.
> I've scanned over free technet documentation, and subscribed to
> newsletters
> - but could use a bit more direction.
> I'd be interested in an SQL guru's advice on how I could ramp up my skill
> quickly - to at least maintain an existing SQL database with an app
> server.
> High quality books (they don't need to start at ground zero, I am a
> proficient SQL writer already), and quality websites, would be greatly
> appreciated. I'm looking for materials that will show me how to provide
> proper maintenace and optimize performance of an SQL server.
> Thanks in advance,
> --
> pbrill1|||Hello!
There are self-training kits you can buy. They are very good.
MCDBA certificate is for SQL Server 2000. There is a new certification path
for SQL Server 2005.
First you need to achieve MCTS: SQL Server 2005 certificate by sitting for
70-431 exam.
http://www.microsoft.com/learning/mcp/mcts/sql/default.mspx
And then you need to achieve MCITP: DBA certificate by sitting for 70-443
and 70-444 exams.
http://www.microsoft.com/learning/mcp/mcitp/dbadmin/default.mspx
You can find recommended sources by Microsoft from the links above to study
on these exams.
Ekrem Ã?nsoy
"pbrill1" <pbrill1@.discussions.microsoft.com> wrote in message
news:36FADB02-C067-42FC-84DD-9A36425B9997@.microsoft.com...
> Would appreciate some advice for a small/mid company IT MCSE that is now
> required to pick up MCDBA skills (with a training budget that limits me to
> Barnes&Noble).
> Our environment has an SQL 2000 on our ERP server; both will be upgraded
> in
> November, where we will have SQL 2005.
> I've scanned over free technet documentation, and subscribed to
> newsletters
> - but could use a bit more direction.
> I'd be interested in an SQL guru's advice on how I could ramp up my skill
> quickly - to at least maintain an existing SQL database with an app
> server.
> High quality books (they don't need to start at ground zero, I am a
> proficient SQL writer already), and quality websites, would be greatly
> appreciated. I'm looking for materials that will show me how to provide
> proper maintenace and optimize performance of an SQL server.
> Thanks in advance,
> --
> pbrill1|||Thank you for the information.
At present, I won't be looking to certify as an SQL DBA (on a personal note
- no training funding until well into 2008) - so I need to run up the
learning curve on a budget of $50 or less.
Microsoft books (hardcover or online) or good how-to websites/blogs that can
show me how to 1) set up a maintenance schedule for SQL 2005 (what to
maintain/how often), and 2) tips/tricks to provide overall performance
improvements (i.e., I don't intend to dive into complex coding to seek
performance improvements) - would be the type of resource that I'm looking
for. A Microsoft SQL 2005 "DBA Secrets" type reference, maybe?
Any advice on inexpensive (again $50 range) resources would be greatly
appreciated.
--
pbrill1
"Dave Patrick" wrote:
> You might find something useful here.
> http://msdn2.microsoft.com/en-us/virtuallabs/aa740409.aspx
> http://www.microsoft.com/learning/assessment/ind/windowsserver/default.mspx#EWD
>
> --
> Regards,
> Dave Patrick ...Please no email replies - reply in newsgroup.
> Microsoft Certified Professional
> Microsoft MVP [Windows]
> http://www.microsoft.com/protect
> "pbrill1" wrote:
> > Would appreciate some advice for a small/mid company IT MCSE that is now
> > required to pick up MCDBA skills (with a training budget that limits me to
> > Barnes&Noble).
> >
> > Our environment has an SQL 2000 on our ERP server; both will be upgraded
> > in
> > November, where we will have SQL 2005.
> >
> > I've scanned over free technet documentation, and subscribed to
> > newsletters
> > - but could use a bit more direction.
> >
> > I'd be interested in an SQL guru's advice on how I could ramp up my skill
> > quickly - to at least maintain an existing SQL database with an app
> > server.
> > High quality books (they don't need to start at ground zero, I am a
> > proficient SQL writer already), and quality websites, would be greatly
> > appreciated. I'm looking for materials that will show me how to provide
> > proper maintenace and optimize performance of an SQL server.
> >
> > Thanks in advance,
> > --
> > pbrill1
>

Advice needed

I have an sql server db on a remote dedicated server that is open on
internet, for remote report writing.
The company that uses is it extremely large and well known, due to this the
sql server gets hammered by bogus logins.
10,000+ of them a day,.
Security wise its ok but the bloody error log files are huge 27-48 mb.
Because I logonto this server remotely atleast once a day and check logs, I
am finding it difficult to read them due to the size for vieving log file
in a TS session.
How can I create 1 error log a day for 7 days then recycle them, or atleast
create them into more manageble sizes.
Regards
DonIf your talking about the Sql Server logs then you can use
sp_cycle_errorlog.
Andrew J. Kelly
SQL Server MVP
"Don Grover" <spamfree@.assoft.com.au> wrote in message
news:e$C62CazDHA.1736@.TK2MSFTNGP09.phx.gbl...
quote:

> I have an sql server db on a remote dedicated server that is open on
> internet, for remote report writing.
> The company that uses is it extremely large and well known, due to this

the
quote:

> sql server gets hammered by bogus logins.
> 10,000+ of them a day,.
> Security wise its ok but the bloody error log files are huge 27-48 mb.
> Because I logonto this server remotely atleast once a day and check logs,

I
quote:

> am finding it difficult to read them due to the size for vieving log file
> in a TS session.
> How can I create 1 error log a day for 7 days then recycle them, or

atleast
quote:

> create them into more manageble sizes.
> Regards
> Don
>

Advice about database deployment

Hello All,
I am writing a database application that will serve multiple companies,
each company contains users that will store/retrieve data from the database.
I am in the process of deciding whether I should have one big database
that stores data for all users of all companies or have a separate
database for each company.
What would be the advantage/disadvantage of selecting one over the other
with the following considerations?
Considerations:
1. failover support
2. performance
3. load balancing via adding multiple database servers
4. clustering
5. backup (full and incremental)
6. database upgrade (eg. adding more tables and relationships, modifying
tables and relationships)
7. special equipment considerations
Any advised would be greatly appreciated.
Thanks in advanced
Hi
Both methods have their advantages and disadvantages so you will have to
weigh up the pros and cons to make a discission. Having a single database may
be ruled out because of security reasons (in fact having databases on the
same instance may be ruled out!) , but it will ease the management and
upgrades. Having single databases will allow you to tailor the databases to
specific requirements and (say) adjust intensive tasks so they don't overload
the system e.g. spread out the backups and other maintenance tasks. Having
separate databases would potentially limit the scope of any mistake (e.g. if
someone managed to take an exclusive lock on a table the impact would be
within a single company not other possibly unrelated companies who could sue
you!).
Hardware clustering should not be affected by either configuration, although
if you are using SQL 2005 and database mirroring you could fail over one
different databases separately and mix the primary instances in similar way
to having multiple instance on a clustered server.
HTH
John
"buzlite@.sympatico.ca" wrote:

> Hello All,
> I am writing a database application that will serve multiple companies,
> each company contains users that will store/retrieve data from the database.
> I am in the process of deciding whether I should have one big database
> that stores data for all users of all companies or have a separate
> database for each company.
> What would be the advantage/disadvantage of selecting one over the other
> with the following considerations?
> Considerations:
> --
> 1. failover support
> 2. performance
> 3. load balancing via adding multiple database servers
> 4. clustering
> 5. backup (full and incremental)
> 6. database upgrade (eg. adding more tables and relationships, modifying
> tables and relationships)
> 7. special equipment considerations
> Any advised would be greatly appreciated.
> Thanks in advanced
>
|||Hi
In addition to John's reply ,I'd ask you ,how big will be databases? Have
you considered to install SQL Server 2005 Express Edition on the company's
site?
It depends on your business requirement , thus there is no common scenario
<buzlite@.sympatico.ca> wrote in message
news:%23Atf%236kCHHA.3916@.TK2MSFTNGP06.phx.gbl...
> Hello All,
> I am writing a database application that will serve multiple companies,
> each company contains users that will store/retrieve data from the
> database.
> I am in the process of deciding whether I should have one big database
> that stores data for all users of all companies or have a separate
> database for each company.
> What would be the advantage/disadvantage of selecting one over the other
> with the following considerations?
> Considerations:
> --
> 1. failover support
> 2. performance
> 3. load balancing via adding multiple database servers
> 4. clustering
> 5. backup (full and incremental)
> 6. database upgrade (eg. adding more tables and relationships, modifying
> tables and relationships)
> 7. special equipment considerations
> Any advised would be greatly appreciated.
> Thanks in advanced
|||On Fri, 17 Nov 2006 08:46:13 -0500, "buzlite@.sympatico.ca"
<buzlite@.sympatico.ca> wrote:

>Hello All,
>I am writing a database application that will serve multiple companies,
>each company contains users that will store/retrieve data from the database.
>I am in the process of deciding whether I should have one big database
>that stores data for all users of all companies or have a separate
>database for each company.
>What would be the advantage/disadvantage of selecting one over the other
>with the following considerations?
>Considerations:
>--
>1. failover support
>2. performance
>3. load balancing via adding multiple database servers
>4. clustering
>5. backup (full and incremental)
>6. database upgrade (eg. adding more tables and relationships, modifying
>tables and relationships)
>7. special equipment considerations
>Any advised would be greatly appreciated.
>Thanks in advanced
* Impact of company-X on the performance of company-Y's operations.
Given a choice like this, perhaps the answer is: both.
Write it for one database for better sharing, it's probably easier to
un-share later, than to add the sharing. Easier to do any
consolidations, when they're on one database, of course.
Then you can deploy it all on one system/instance or on N
systems/instances, if one of the big companies decides they want their
own servers after all.
J.
|||I would say that the data and amount of data from one company could be
pretty large. Given that images can be uploaded to the database in
addition to text.
Given a previous reply to this posting and the fact that large amounts
of data can be produce by any or all given companies, the performance
degradation related factor is indeed a point that needs to be considered.
Thanks
Uri Dimant wrote:
> Hi
> In addition to John's reply ,I'd ask you ,how big will be databases? Have
> you considered to install SQL Server 2005 Express Edition on the company's
> site?
> It depends on your business requirement , thus there is no common scenario
>
>
> <buzlite@.sympatico.ca> wrote in message
> news:%23Atf%236kCHHA.3916@.TK2MSFTNGP06.phx.gbl...
>
|||To Add to the original post, what would the impact of using one database
for all companies and one database instance for each company as it
relates to the following:
Full backups
Transaction log backups
Rebuilding indexes
Integrity Check
buzlite@.sympatico.ca wrote:
> Hello All,
> I am writing a database application that will serve multiple companies,
> each company contains users that will store/retrieve data from the
> database.
> I am in the process of deciding whether I should have one big database
> that stores data for all users of all companies or have a separate
> database for each company.
> What would be the advantage/disadvantage of selecting one over the other
> with the following considerations?
> Considerations:
> --
> 1. failover support
> 2. performance
> 3. load balancing via adding multiple database servers
> 4. clustering
> 5. backup (full and incremental)
> 6. database upgrade (eg. adding more tables and relationships, modifying
> tables and relationships)
> 7. special equipment considerations
> Any advised would be greatly appreciated.
> Thanks in advanced

Advice about database deployment

Hello All,
I am writing a database application that will serve multiple companies,
each company contains users that will store/retrieve data from the database.
I am in the process of deciding whether I should have one big database
that stores data for all users of all companies or have a separate
database for each company.
What would be the advantage/disadvantage of selecting one over the other
with the following considerations?
Considerations:
--
1. failover support
2. performance
3. load balancing via adding multiple database servers
4. clustering
5. backup (full and incremental)
6. database upgrade (eg. adding more tables and relationships, modifying
tables and relationships)
7. special equipment considerations
Any advised would be greatly appreciated.
Thanks in advancedHi
Both methods have their advantages and disadvantages so you will have to
weigh up the pros and cons to make a discission. Having a single database ma
y
be ruled out because of security reasons (in fact having databases on the
same instance may be ruled out!) , but it will ease the management and
upgrades. Having single databases will allow you to tailor the databases to
specific requirements and (say) adjust intensive tasks so they don't overloa
d
the system e.g. spread out the backups and other maintenance tasks. Having
separate databases would potentially limit the scope of any mistake (e.g. if
someone managed to take an exclusive lock on a table the impact would be
within a single company not other possibly unrelated companies who could sue
you!).
Hardware clustering should not be affected by either configuration, although
if you are using SQL 2005 and database mirroring you could fail over one
different databases separately and mix the primary instances in similar way
to having multiple instance on a clustered server.
HTH
John
"buzlite@.sympatico.ca" wrote:

> Hello All,
> I am writing a database application that will serve multiple companies,
> each company contains users that will store/retrieve data from the databas
e.
> I am in the process of deciding whether I should have one big database
> that stores data for all users of all companies or have a separate
> database for each company.
> What would be the advantage/disadvantage of selecting one over the other
> with the following considerations?
> Considerations:
> --
> 1. failover support
> 2. performance
> 3. load balancing via adding multiple database servers
> 4. clustering
> 5. backup (full and incremental)
> 6. database upgrade (eg. adding more tables and relationships, modifying
> tables and relationships)
> 7. special equipment considerations
> Any advised would be greatly appreciated.
> Thanks in advanced
>|||Hi
In addition to John's reply ,I'd ask you ,how big will be databases? Have
you considered to install SQL Server 2005 Express Edition on the company's
site?
It depends on your business requirement , thus there is no common scenario
<buzlite@.sympatico.ca> wrote in message
news:%23Atf%236kCHHA.3916@.TK2MSFTNGP06.phx.gbl...
> Hello All,
> I am writing a database application that will serve multiple companies,
> each company contains users that will store/retrieve data from the
> database.
> I am in the process of deciding whether I should have one big database
> that stores data for all users of all companies or have a separate
> database for each company.
> What would be the advantage/disadvantage of selecting one over the other
> with the following considerations?
> Considerations:
> --
> 1. failover support
> 2. performance
> 3. load balancing via adding multiple database servers
> 4. clustering
> 5. backup (full and incremental)
> 6. database upgrade (eg. adding more tables and relationships, modifying
> tables and relationships)
> 7. special equipment considerations
> Any advised would be greatly appreciated.
> Thanks in advanced|||On Fri, 17 Nov 2006 08:46:13 -0500, "buzlite@.sympatico.ca"
<buzlite@.sympatico.ca> wrote:

>Hello All,
>I am writing a database application that will serve multiple companies,
>each company contains users that will store/retrieve data from the database
.
>I am in the process of deciding whether I should have one big database
>that stores data for all users of all companies or have a separate
>database for each company.
>What would be the advantage/disadvantage of selecting one over the other
>with the following considerations?
>Considerations:
>--
>1. failover support
>2. performance
>3. load balancing via adding multiple database servers
>4. clustering
>5. backup (full and incremental)
>6. database upgrade (eg. adding more tables and relationships, modifying
>tables and relationships)
>7. special equipment considerations
>Any advised would be greatly appreciated.
>Thanks in advanced
* Impact of company-X on the performance of company-Y's operations.
Given a choice like this, perhaps the answer is: both.
Write it for one database for better sharing, it's probably easier to
un-share later, than to add the sharing. Easier to do any
consolidations, when they're on one database, of course.
Then you can deploy it all on one system/instance or on N
systems/instances, if one of the big companies decides they want their
own servers after all.
J.|||I would say that the data and amount of data from one company could be
pretty large. Given that images can be uploaded to the database in
addition to text.
Given a previous reply to this posting and the fact that large amounts
of data can be produce by any or all given companies, the performance
degradation related factor is indeed a point that needs to be considered.
Thanks
Uri Dimant wrote:
> Hi
> In addition to John's reply ,I'd ask you ,how big will be databases? Have
> you considered to install SQL Server 2005 Express Edition on the company's
> site?
> It depends on your business requirement , thus there is no common scenari
o
>
>
> <buzlite@.sympatico.ca> wrote in message
> news:%23Atf%236kCHHA.3916@.TK2MSFTNGP06.phx.gbl...
>|||To Add to the original post, what would the impact of using one database
for all companies and one database instance for each company as it
relates to the following:
Full backups
Transaction log backups
Rebuilding indexes
Integrity Check
buzlite@.sympatico.ca wrote:
> Hello All,
> I am writing a database application that will serve multiple companies,
> each company contains users that will store/retrieve data from the
> database.
> I am in the process of deciding whether I should have one big database
> that stores data for all users of all companies or have a separate
> database for each company.
> What would be the advantage/disadvantage of selecting one over the other
> with the following considerations?
> Considerations:
> --
> 1. failover support
> 2. performance
> 3. load balancing via adding multiple database servers
> 4. clustering
> 5. backup (full and incremental)
> 6. database upgrade (eg. adding more tables and relationships, modifying
> tables and relationships)
> 7. special equipment considerations
> Any advised would be greatly appreciated.
> Thanks in advanced

Advice about database deployment

Hello All,
I am writing a database application that will serve multiple companies,
each company contains users that will store/retrieve data from the database.
I am in the process of deciding whether I should have one big database
that stores data for all users of all companies or have a separate
database for each company.
What would be the advantage/disadvantage of selecting one over the other
with the following considerations?
Considerations:
--
1. failover support
2. performance
3. load balancing via adding multiple database servers
4. clustering
5. backup (full and incremental)
6. database upgrade (eg. adding more tables and relationships, modifying
tables and relationships)
7. special equipment considerations
Any advised would be greatly appreciated.
Thanks in advancedHi
Both methods have their advantages and disadvantages so you will have to
weigh up the pros and cons to make a discission. Having a single database may
be ruled out because of security reasons (in fact having databases on the
same instance may be ruled out!) , but it will ease the management and
upgrades. Having single databases will allow you to tailor the databases to
specific requirements and (say) adjust intensive tasks so they don't overload
the system e.g. spread out the backups and other maintenance tasks. Having
separate databases would potentially limit the scope of any mistake (e.g. if
someone managed to take an exclusive lock on a table the impact would be
within a single company not other possibly unrelated companies who could sue
you!).
Hardware clustering should not be affected by either configuration, although
if you are using SQL 2005 and database mirroring you could fail over one
different databases separately and mix the primary instances in similar way
to having multiple instance on a clustered server.
HTH
John
"buzlite@.sympatico.ca" wrote:
> Hello All,
> I am writing a database application that will serve multiple companies,
> each company contains users that will store/retrieve data from the database.
> I am in the process of deciding whether I should have one big database
> that stores data for all users of all companies or have a separate
> database for each company.
> What would be the advantage/disadvantage of selecting one over the other
> with the following considerations?
> Considerations:
> --
> 1. failover support
> 2. performance
> 3. load balancing via adding multiple database servers
> 4. clustering
> 5. backup (full and incremental)
> 6. database upgrade (eg. adding more tables and relationships, modifying
> tables and relationships)
> 7. special equipment considerations
> Any advised would be greatly appreciated.
> Thanks in advanced
>|||Hi
In addition to John's reply ,I'd ask you ,how big will be databases? Have
you considered to install SQL Server 2005 Express Edition on the company's
site?
It depends on your business requirement , thus there is no common scenario
<buzlite@.sympatico.ca> wrote in message
news:%23Atf%236kCHHA.3916@.TK2MSFTNGP06.phx.gbl...
> Hello All,
> I am writing a database application that will serve multiple companies,
> each company contains users that will store/retrieve data from the
> database.
> I am in the process of deciding whether I should have one big database
> that stores data for all users of all companies or have a separate
> database for each company.
> What would be the advantage/disadvantage of selecting one over the other
> with the following considerations?
> Considerations:
> --
> 1. failover support
> 2. performance
> 3. load balancing via adding multiple database servers
> 4. clustering
> 5. backup (full and incremental)
> 6. database upgrade (eg. adding more tables and relationships, modifying
> tables and relationships)
> 7. special equipment considerations
> Any advised would be greatly appreciated.
> Thanks in advanced|||On Fri, 17 Nov 2006 08:46:13 -0500, "buzlite@.sympatico.ca"
<buzlite@.sympatico.ca> wrote:
>Hello All,
>I am writing a database application that will serve multiple companies,
>each company contains users that will store/retrieve data from the database.
>I am in the process of deciding whether I should have one big database
>that stores data for all users of all companies or have a separate
>database for each company.
>What would be the advantage/disadvantage of selecting one over the other
>with the following considerations?
>Considerations:
>--
>1. failover support
>2. performance
>3. load balancing via adding multiple database servers
>4. clustering
>5. backup (full and incremental)
>6. database upgrade (eg. adding more tables and relationships, modifying
>tables and relationships)
>7. special equipment considerations
>Any advised would be greatly appreciated.
>Thanks in advanced
* Impact of company-X on the performance of company-Y's operations.
Given a choice like this, perhaps the answer is: both.
Write it for one database for better sharing, it's probably easier to
un-share later, than to add the sharing. Easier to do any
consolidations, when they're on one database, of course.
Then you can deploy it all on one system/instance or on N
systems/instances, if one of the big companies decides they want their
own servers after all.
J.|||I would say that the data and amount of data from one company could be
pretty large. Given that images can be uploaded to the database in
addition to text.
Given a previous reply to this posting and the fact that large amounts
of data can be produce by any or all given companies, the performance
degradation related factor is indeed a point that needs to be considered.
Thanks
Uri Dimant wrote:
> Hi
> In addition to John's reply ,I'd ask you ,how big will be databases? Have
> you considered to install SQL Server 2005 Express Edition on the company's
> site?
> It depends on your business requirement , thus there is no common scenario
>
>
> <buzlite@.sympatico.ca> wrote in message
> news:%23Atf%236kCHHA.3916@.TK2MSFTNGP06.phx.gbl...
>> Hello All,
>> I am writing a database application that will serve multiple companies,
>> each company contains users that will store/retrieve data from the
>> database.
>> I am in the process of deciding whether I should have one big database
>> that stores data for all users of all companies or have a separate
>> database for each company.
>> What would be the advantage/disadvantage of selecting one over the other
>> with the following considerations?
>> Considerations:
>> --
>> 1. failover support
>> 2. performance
>> 3. load balancing via adding multiple database servers
>> 4. clustering
>> 5. backup (full and incremental)
>> 6. database upgrade (eg. adding more tables and relationships, modifying
>> tables and relationships)
>> 7. special equipment considerations
>> Any advised would be greatly appreciated.
>> Thanks in advanced
>|||To Add to the original post, what would the impact of using one database
for all companies and one database instance for each company as it
relates to the following:
Full backups
Transaction log backups
Rebuilding indexes
Integrity Check
buzlite@.sympatico.ca wrote:
> Hello All,
> I am writing a database application that will serve multiple companies,
> each company contains users that will store/retrieve data from the
> database.
> I am in the process of deciding whether I should have one big database
> that stores data for all users of all companies or have a separate
> database for each company.
> What would be the advantage/disadvantage of selecting one over the other
> with the following considerations?
> Considerations:
> --
> 1. failover support
> 2. performance
> 3. load balancing via adding multiple database servers
> 4. clustering
> 5. backup (full and incremental)
> 6. database upgrade (eg. adding more tables and relationships, modifying
> tables and relationships)
> 7. special equipment considerations
> Any advised would be greatly appreciated.
> Thanks in advanced

Sunday, March 11, 2012

Advanced Identity Fields

Hi!

a) PROBLEM 1:

I have set up my main database like this (of course I'm showing an abbreviation):

company - int (identity)
name - nchar

I have several companies stored in the previous table. Now I have another table with messages:

company - int (related with the company of the previous table)
messageID - int (identity)
contents - nchar

company and messageID are the main key of this table. I want to set the messageID column to change automatically. Since I declared it as identity it is working fine, but I was looking to start it on 0 on every new company:

Company messageID
0 0
0 1
0 2
1 0 <- Here the company changed, so the messageID resets
1 1
1 2
1 3
2 0 <- Again
2 1

Any suggestions?

b) PROBLEM 2:
I have my database stored locally on my computer. When I finished working with the database it has a lot of data for testing. I want to upload the database to my hosting provider or to my customer's. But the identity columns keep incrementing since the last value of my tests, so it's kind of annoying to see values as: 1250, 223, etc. when I expect to see 0,1, 2 and so on. Also, for receipts this is a very important issue.

How can I reset the identity fields?

Thank you very much for your attention and help.

CT

DBCC CHECKIDENT (tblName, RESEED, 0)

so the next record will start from 1

HTH

|||

#1 You have to create trigger on this table for insert which will automatically calculate your message ID based on number of messages for company for which you insert record.

# 2 I suppose that you would like to remove test data from your table so you will be safe using TRUNCATE TABLE to delete all records and reset identity to 1

|||I really appreciate if you can give a sample for this. I'm worried that the trigger procedure wont be able to handle concurrency.

Thursday, March 8, 2012

Advanatages of SQL 2005

Can someone outline the advantages of SQL 2005 over SQL 2000 and why a company would want to upgrade from SQL 2000 to SQL 2005?
Thank youHere is a quick summary of some differences/advantages of 2005

http://www.aspfaq.com/show.asp?id=2343|||It would ultimately depend on the company's requirements, and how willing they are to get there. For example, is this company willing to send someone from the IT department to train on SQL 2005?
As for the benefits, the one benefit all applications will derive is that SQL 2005 is generally faster than SQL 2000. You can't put a real factor of speed increase on it, but I have seen up to 4 times faster on the same hardware. That could be because I am lucky when I pick my examples, though.
If you are willing to put development effort into an application, you can get built-in encryption for sensitive data, built-in partitioning for large sets of data, or any of the bolt-on applications Microsoft is pushing with the SQL Licenses these days (Reporting Services, Notification Services, Analysis Services, or Integration Services). Outside of that, you would have to look at and probably test your application on 2005 to see what you get out of it.|||Also MS weblinks for more information (though they talk more about their product)
http://www.microsoft.com/sql/prodinfo/features/default.mspx
http://www.microsoft.com/sql/downloads/trial-software.mspx
1. SQL Server Integration Services is the new version of DTS. It is a complete rewrite of the product rather than an upgrade and will put give MS an ETL tool on an equal footing with the big ETL players.
2. Analysis Services has been completely re-architected to include (such as) multiple hierarchies in a dimension, KPIs, perspectives, and many other things all hosted in a new conceptual object called the Unified Dimensional Model (UDM).
3. CLR Integration - Stored procedures/functions can now be written in a .Net language.
4. Table partitioning improvements
5. Reporting Services enhancements
... for more list of features refer to above links.

Monday, February 13, 2012

ado connection

i have developed an application that connects to SQL Server 2000.

on my machine as well as 90 % of our company's machines it works fine. but the rest (xp machines) it doesn't want to work. it keeps telling me my provider is not installed correctly. i have tried various installation of mdac but they don't install.

i see on msdn they say it could be a localization error but the workaround they give doesn't work.

what else can i try

Hi,

whats the excat error message you are gettin g?

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de
|||

hi

it says "Provider cannot be found. it may not be properly installed"

|||

i found the solution

just repair XP

it was the only thing i found that worked.