SQL Server Design Issue

Sep 21, 2005

Hi Folks,

First post here so hope somebody can be of some help.

I have a table of product information from manufacturers, which has a number of child tables etc. It's basically a collection of tables, related, that contain product information for around 100,000 products.

We also have a table with a list of products that are for sale. Of course, every row isn't going to match so I can't create a PK->FK relationship.

Does anybody have any ideas on a design solution? I'm pretty sure the solution is very simple and I've just overlooked it.

Kind Regards

View 3 Replies


ADVERTISEMENT

DB Design :: Database Design For Matrix Representation

May 13, 2015

I have a scenario like below

Product1
Product2 Product3
Product4 Product5
Product1 1
1 0 0
1
Product2 1
1 0 0
1
Product3 0
0 1 1
0
Product4 0
0 1 1
0
Product5 1
1 0 0
1

How to design tables in SQL Server for the above.

View 2 Replies View Related

Database Design/query Design

Feb 13, 2002

Ok, I'm doing a football database for fixtures and stuff. The problem I am having is that in a fixture, there is both a home, and an away team. The tables as a result are something like this:

-------
Fixture
-------
fix_id
fix_date
fix_played

----
Team
----
tem_id
tem_name

-----------
TeamFixture
-----------
fix_id
tem_id
homeorawayteam
goals

It's not exactly like that, but you get the point. The question is, can I do a fixture query which results in one record per fixture, showing both teams details. The first in a hometeam field and the second in an away team field.

Fixture contains the details about the fixture like date and fixture id and has it been played

Team contains team info like team id, name, associated graphic

TeamFixture is the table which links the fixture to it's home and away team.

TeamFixture exists to prevent a many to many type relationship.

Make sense? Sorry if this turns out to be really easy, just can't get my head around it at the mo!

View 2 Replies View Related

DB Design :: Table Design For Packages

Aug 18, 2015

I would like to create a table called product. My objective is to get list of packages available for each product in data grid view column while selecting each product. Each product may have different packages type (eg:- Nos, CTN, OTR etc). Some product may have two packages and some for 3 packages etc. Quantity in each packages also may be differ ( for eg:- for some CTN may contain 12 nos or in other case 8 nos etc). Prices for each packages also will be different that also need to show.  How to design the table.. 

Product name   :  
Nestle milk |
Rainbow milk
packages  :
CTN,OTR, NOs |

CTN, NOs
Price:
50,20,5 |
40,6

(Remarks for your reference):CTN=10nos, OTR=4 nos  
| CTN=8 Nos

View 3 Replies View Related

SQL Server Design Problem

Feb 12, 2007

Hi there,
I foolishly did not allow enough characters for a char field in SQL Server 2000. Had to change it - now I can't get the table design to update when I insert or update a record. Recreated DataAdapter, detached table and re-attached, deleted connection... I'm running out of ideas - any suggestions. Thanks.

View 1 Replies View Related

Sql Server + Application Design

Apr 27, 2007

I'm designing an application that will be deployed to 500 users. It is very database intensive (selects, inserts, updates, deletes). One select statement could possibly have up to 20,000 records returned. My question is, where should I put the database? Is this a bad candidate to have the database on one remote server? Or should I install sql server express on each users desktop? Any design issues I should consider?

View 4 Replies View Related

Database Design In SQL Server 2005

Jan 11, 2007

HiI am facing a problem in designing a database for my project.Please help
I have hotel Information.The hotel allocates rooms for my company.This is done on weekly basis.
Now suppose in first week of a year the number of rooms allocated to the company is 3,2ndweek =5,3rdWeek=5 and so on...
So when i search based on a week i should have one result setIf i search based on MOnth i should have one result set.. in this way.
So what fields i need to take in a database table so that when i search based on week /month/quarter/year i get different resultsets.

View 6 Replies View Related

Best Design Transfer Data Between Two Server.

Nov 28, 2007

Hi All,

What is the best way to transfer data from a web-farm to another server for web-report?

Mirror?
Replication?
Daily Schedule job?
Other?

What are the advance and dis-advance of each type?
thanks

View 7 Replies View Related

Web Server Hardware Design With SQL Back-end

Jul 20, 2005

Hi,Still in the design process of a Windows 2003 web server with a SQL backend.Expecting to have about 2000 visitors a day accessing lists and searchqueries on a 200-300 MB db. This server will be collocated in a datacenter.I have a few scenarios that I would appreciate in getting somecomments/criticism on:Scenario 1:Box 1, SBS 2003 Premium (with SQL 2000), 2GB RAM, Raid 5 HDBased on the SBS faq, as long as visitors are not Windows authenticated, anadditional SQL Internet license is not required.My concern with this scenario is (correct me if I'm wrong) lack ofscalability and fail-over (in the future).Scenario 3:Box 1, Windows 2003 Standard Edition, SQL 2000 Standard Edition, 2GB RAM,Raid 5 HDDo I need a processor based SQL license since it's exposed to the Internetor is this the same case as in the SBS where an additional license is notrequired?Scenario 3:Box 1, Windows 2003 Web Edition, 1GB RAM, Raid 1 HDBox 2, Windows 2003 Standard Edition, SQL 2000 Standard Edition, 1GB RAM,Raid 5 HDWeb Edition faq states that I can not deploy SQL on it. I'm guessing I canstill connect to another server's SQL.Is this setup more secure, in the sense that the SQL is on a separate boxfrom the web server?All comments are very appreciated. If you have other suggestions too, pleaselet me know.Thank youGreg

View 3 Replies View Related

Design Pages On Report Server

Aug 1, 2007



Hi every body

I have developed an reporting solution for a customer with reporting services and using report builder.
When he connect to http://localhost/reports , he see the page like


http://img215.imageshack.us/img215/583/folderhl1.jpg

But i would to custom design of my default page, and other maybe. Where i can do it ?

Thanks all
Regards
Erwan Sarcelet, France

View 4 Replies View Related

Design Question SQL Server 2005

Apr 4, 2006

I am very new to SQL Server 2005. I have a database of criminal records consisting of a master table of names where the primary key is a case number and 3 related minor tables: violations, charges, and appeals. They are linked by the case number with a one-to-many relationship. Not all of these tables have a record for every master record.

I am designing a simple lookup program in VB 2005 in which info from all tables will be on one screen. A search will be done on either name or case number.

What is the best way so set up views and/or stored procs for such a program? Do I need a stored proc for each minor table or is there a way to set up one proc to pull all of the info? Did I mention I was new at this? I have worked a lot with Access and recognize just enough things in SQL Server to be really confused.

Thanks for the help!

View 1 Replies View Related

DB Design :: Implementing Hierarchies In Server

Jun 12, 2015

I want to be able to implement infinite levels of Hierarchies in SQL Server (2012), in addition to being able to address issues like same child having more than one parent (eg. An Employee could end up having 2 different managers - eg. Project Manager,  Delivery Manager).

One way is to have self referencing table (where each row has a parent id , referencing to a parent record - but this would not work in cases where a child  has more than 1 parent).

Are there other more efficient ways? What is the best way to implement this?

View 9 Replies View Related

DB Design :: Server Procedures Migration

Jul 27, 2015

We are migrating sql server Stored Procedures from 2005 to 2012.We are facing some conflicts(Keyword changes) while migrating into 2012. We are executing each and every stored procedure and finding some keyword changes.We have nearly 2000 stored procedures. It is a time consuming process.

What are the best way to find out the changes in 2012. Anyscript(Sql server) to find out/what are the changes need to be change in 2012.

View 3 Replies View Related

New Databases In SQL Server...easy Design Methods?

Dec 2, 2005

I am new to using SQL Server but will be having to get to know it at work and have downloaded SQL Server 2005 Express to tinker with at home.

What are the easiest methods to set up a relational database?

Are there any tools you can download to give SQL Server or the express version functionality similar to Access?

Can you get a tool to allow you to not only design tables in design view but then go on to create relationships and a database model?

Please excuse my ignorance if this is possible already, can anyone provide any links to getting started links?

There seems to be plenty out there about writing queries and stored procedures etc. but I haven't found as much about setting up a database from scratch.

Thanks in advance,

JJJ.

View 12 Replies View Related

Database Design - Performance SQL Server 2000

Jul 28, 2006

Hi

I have a database that stores all the data in one table that is only the data we are required to store hence it didnt require any other tables

the table has five colunms

Orderid, ordercost, orderdate, ordersystem, orderref

it is used in an web application that seraches for all the rest of the information using an orderid and displays the rest of the details the size of the table currently is about 123000 records that is increasing by 20000 every week.

i have an archive of the same data that has 7,666,000 records that are also going to be placed into the same database.

my question is is that a good idea of doing this?
are there any performance issues that i need to be aware of as currently the application runs quite quick?

View 15 Replies View Related

MSDE And SQL Server 2000 Design Questions...

Jul 20, 2005

Hello gurus:Hopefully someone can shed some light on some questions I have. I amtasked to build an application that will schedule and track tasks. Ifirmly believe in not reinventing the wheel however also feel thatcustomizing is certainly not out of the question.I am looking to build something in ASP (or .NET) that can allow anindividual to work "disconnected" from the network while stillaccessing a database (MSDE?) that will sync with SQL 2000 oncere-connected. I have built multiple db apps that are strictly webbased and consider myself somewhat knowledgeable (read.. dangereous)SQL/ASP dude. I understand that for a stand-alone client app I mayhave to use .NET and load the framewsork on the client in order to runthe dynamic pages for database updates. Here are my questions:1) Is there a way for SQL server to "replicate" its tables into aschema/data recognized by MSDE (i.e. generate the "mother ship" tablesand schema first, then use SQL Server to automatically create (export)the client MSDE tables)2) are there tools to manage MSDE so one can see what the heck is inthere? I understand Enterprise manager will not work in this regard.3) Are there any resources (documents, tutorials etc..) for datareplication (i.e. dbsync from MSDE up to MSSQL and vice-versa)4) Am I wasting my time doing this from scratch because there isalready something out there that does all this that is moderatelypriced and customizable?Thanks for your attention and consideration.Eric B

View 1 Replies View Related

Altering SQL Server 2000 Table Design

Jul 20, 2005

I'm trying to do a simple alteration to the table design of one of ourSQL 2k tables, simply changing an identity row so that its not 'notfor replication', and its taking absolutely ages to do so, and stopsthe sql server from working.Whilst it's attempting the update, no one can access the database, thesqlservr.exe memory usage shoots up and enterprise manager reports anot responding status. Eventually after about 10 minutes, it bombs outreporting,Unable to modify tableCould not allocate space for object 'Tmp_TableName' in database'DBNAME' because the 'PRIMARY' filegroup is full.The table i'm attempting to change has only about 4000 records sothere's not a huge amount of data.Any ideas what's causing this and how i can get around it?A similar thing happens when i attempt to change the length of avarchar too.Thanks in advance for any suggestionsDan Williams.

View 3 Replies View Related

DB Design :: Join Two Table From Two Different Databases But Same Server

Nov 9, 2015

I am trying to join two table from two different databases.

Database 1 = Agent and Table = Stats 
Database 2 = Amount and Table = Sales 

The common field is Expr1 (table1) and Initials (table2)

View 7 Replies View Related

DB Design :: How To Split One Column Into Two Columns In Server

Mar 6, 2015

I have a ipaddress column is there where i need to split the column into two columns because of values like below

172.26.248.8,Fe80::7033:acba:a4bd:f874
172.26.248.8,Fe80::7033:acba:a4bd:f874
172.26.248.8,Fe80::7033:acba:a4bd:f874

I have written the below query but it will throuh some error.

  select SUBSTRING(IPAddress0, 1, CHARINDEX(',', IPAddress0) - 1) as IPAddress0 
   from IPADDRESS
error:
Msg 537, Level 16, State 2, Line 1

Invalid length parameter passed to the LEFT or SUBSTRING function.

View 16 Replies View Related

SQL Server Timeout Is By Design When Using Full-text???

Apr 21, 2008

Well, I just spent 2 days tediously debugging an issue with SQL Server 2005 and I have my answer, but I am disappointed... Here's the story. I have a simple Full-Text query integrated into my .NET app. Since app launch I have been getting intermittent complaints that the program does not work, and yet I was never able to reproduce the behavior. I finally got the stack trace from a user and it was a time out exception. On the weekend, I decided to work a bit and the FT (Full-Text) query was the first I tried. Boom - Timeout! Rerunning the query though, does not timeout! Exactly what my users are seeing. Subsequent queries return in the usual 0.5 seconds. So after running many traces over 2 days, I determined that Full-Text queries time out on the first FT query run after 45 seconds and the timeout will happen again if no FT queries are run for 30 minutes. So basically, if we run text queries less frequently than every 30 minutes, we get a timeout every time!!! So with this info, I finally found the fix...

http://support.microsoft.com/kb/915850

So this fix is spot on and the Status says: This behavior is by design. My problem is resolved with this command - sp_fulltext_service 'verify_signature', 0. But, the fix supposedly opens a security hole? So here are my questions:

1. How worried about this security hole should I be?
2. My server has internet access! So why am I getting the timeout? Internet Explorer works fine.
3. So since the query times-out with the verify_signature = 1, why are the subsequent queries allowed to execute? Shouldn't the subsequent queries fail as well since the word breaker is un-verified? Seems to me that if you're gonna let subsequent queries run without signature verification, why make the first one wait 45 seconds and timeout?
4. This timeout event should have AT LEAST shown some event in the trace that the timeout happened... Trace only showed that FT portion of query took almost exactly 45 seconds. Even with all the FT Event Classes turned on I saw nothing indicating a signature verification timeout.

Note: considering the fact that I have Internet access and still see this problem, it may be more widespread of a problem than MS believes. Also, others may be experiencing this and not realize what is happening because of the lack of any Trace events and the inability to reproduce! People may think (as I did) that the SQL Server is flakey or the network is flakey. I'd really like to see a hot-fix to address this.

Thanks,
-Valkyrie-MT

View 6 Replies View Related

Design Question, Trigger Or SP [SQL Server 2005]

May 24, 2008



[SQL Server 2005]



In our system we keep track on all changes that are made by the users.

This means that posts is never deleted, only marked as not "active".

Each table has a SP who takes care of the INSERT/UPDATE.

This SP also calls another SP, which actually does the "inactive" marking of the post.

The question is:

Would it be better (or worse) to have a TRIGGER taking care of this instead?

Occasionally there are data inserted at the "exact" same time (different input sources).
Sometimes there can be a quite heavy workload on the INSERT.



/Håkan

View 8 Replies View Related

DB Design :: How To Create READ ONLY Database In Server

Oct 6, 2015

Is it possible to create a database which design or data is not needed to update and i want to set to it as a READ ONLY. what are the steps to create such type of database?

View 3 Replies View Related

MCSE SQL Server 2000 Design 70-229 Exam

Mar 17, 2008

Hi,


I am studying for the above exam and have got a new laptop with the basic version of Vista pre-installed on it. I've got an evaluation version of SQL Server 2000 I got from a Microsoft event but the basic version of Vista I have, will not let me install it.

Can anyone advise me whether SQL Server Express will be useful in studying for the SQL Server 2000 Design 70-229 Exam?

If not, I see my options as fork out for an older OS licence - XP pro to put on the laptop which would allow me to install the evaluation edition. Not my first choice but it would do...

Thank you,

Mark Smith

View 5 Replies View Related

DB Design :: Resizing LDF And MDF Files Of Server Databases

Jul 9, 2015

I want to control the size of ldf files and mdf files of several databases on SQL Server 2008 in my organization (manual increase), but i have a question:

What would be the best practices (best methods) for provisioning a ldf file and mdf file?  Exists any generic formula?

With this i want to avoid the shrink operation and the autogrow of sql server databases...

View 6 Replies View Related

SQL Server Schema Issue With Design Time Controls

Mar 9, 2007

Hello, we have some tables and views that are not assigned to the standard schema of dbo.Whenever I try to use a design time control and/or SQLDataSource connection control, it does not like objects other than those using the dbo. schema.Any ideas on how to resolve this issue?For example, her are a couple of views:dbo.vwCustomersdbo.vwCustomerDetailsord.vwOrdersord.vwOrderDetailsthe views with dbo.* I have no problem with.the views with ord. it tells me the view(s) do not exist.Thanks in advance! 

View 1 Replies View Related

SQL Server Admin 2014 :: Design AlwaysOn Cluster

May 8, 2015

I got 5 SQL Servers 2008R2 (2x CPUs with 96-384Gb of RAM) with total 1500DBs and around 10Tb of allocated data. Now

I am forced to upgrade to 2012 and 2014, but the old hardware is overkill.

Is it possible to consolidate this to a large SQL AlwaysOn cluster?

We pros/cons could it be to have 2 or 4 nodes?

2 or 4 sockets servers?

My goal was to use ~20 cores Enterprise license on active server.

View 1 Replies View Related

SQL Server 2008 :: Table(s) Design For Messaging Functionality?

Jul 21, 2015

I'm in the process of building messaging functionality in to my application where by users can contact one another, look at it as a dating site, you click on someones profile, view their profile and then send that user a message.

I started to build the table which looked like this:

Id (PK) (Increments by 1)

ToUserId (FK) -- User who they're getting in contact with

FromUserId (FK) -- User who sent the message

Content (nvarchar(3000)) -- Message being send

Status (int) -- read / new / deleted / sent

EmailDate (datetime)

EmailDeleted (datetime)

But the problem with this setup is both user's maybe sending / replying to each other so I would have multiple entries / statuses in one table which may become a nightmare to manage / control.

View 9 Replies View Related

DB Design :: Prevent Server From Automatically Adding Brackets

Aug 17, 2015

I have a problem setting the default value of a column. I am trying to set it to

(CONVERT([float],getdate()+(2),0))

However, SQL Server automatically sets it to

(CONVERT([float],getdate()+(2),(0)))

While it functionally does not change anything, we have a tool which compares the database schema against a pre-existing schema and shows this as an error.I have tried setting the value directly and through scripts but it does not work either way.

View 2 Replies View Related

DB Design :: Getting The List Of Database Names From Remote Server?

Nov 2, 2015

In our application we are copying data between 2 sqlserver databases using linked server.  Say, sqlserver1 is source and sqlserver2 is destination, then, our application will be on sqlserver2 box and will copy data from sqlserver1 to sqlserver2.

User also need to choose from which database of sqlserver1, the data need to be copied. This data is our application data.. Nothing related to sqlserver database.

We are using the following query, to get the database names of the source sqlserver..

SELECT * FROM <linked server to dest db>.master.sys.databases

My questions is : is this query generic enough that works on all sqlserver versions?

Is the master database name of sqlserver configurable or its alwasys fixed as "master"?

View 4 Replies View Related

DB Design :: Failed To Start / Server Services Are Not Started

May 18, 2015

while failover from one node to another node in cluster environment. cluster node is moving to another node but my SQL server services are not started.in event viewer i am getting bellow errorr event id 19019

[sqsrvres] StartResourceService: StartService (MSSQLSERVER) failed. Error: 42d
[sqsrvres] OnlineThread: Error 42d bringing resource online.

View 2 Replies View Related

DB Design :: Foreign Key Referencing Non Unique Field In Server

Oct 12, 2012

I ran into an interesting situation.  I'm working on contract and was looking at creating an ERD for an existing database when I ran into a problem.  I found FK's that are referencing columns that do not have a unique constraint or a unique index. 

I don't know the history of the database but was there a time in SQL Server history where this would have been possible?  I scripted out the tables and created it in a test database.  When I run the script to create the FK I get the following message. 

I double checked the original tables and this FK does exist in table1 and there is no unique anything in the referenced table, table2.  Currently the database is running on SQL Server 2008 Ent.

ALTER TABLE [dbo].[table1] WITH CHECK ADD CONSTRAINT [FK_table1] FOREIGN KEY([Col1])
REFERENCES [dbo].[table2] ([col2])

There are no primary or candidate keys in the referenced table 'dbo.table2' that match the referencing column list in the foreign key 'FK_table1'.

View 4 Replies View Related

SQL Server 2014 :: Best Design For Multiple Validation Checking Of Data

Sep 17, 2015

I want to do something with error checking in my company. For this we have a selection of different tables and the data needs to meet various validation rules else it is classed as an error.

To deal with this I'm currently thinking of this approach:

1. Create a view pulling all of the various data together from the multiple tables.
2. Create an empty 'errors' data table.
3. Create an Excel file with a button to call a Check for Errors Script

Then in the the script:

1. Clear the 'errors' data table
2. Call multiple scripts, each of which uses the new view, applies the checks for that specific error and writes any erroring data into the 'errors' data table (along with a text string with the unique error code for filtering / sorting purposes).
3. After calling all the scripts, the table can be refreshed in excel when when used with a pivot table can show the various errors, and let us drill down into all the data so we can fix them.

Also.. Ideally, I'd like some way to write comments in an excel column for each entry and error code and be able to write that back into a comment table.

View 5 Replies View Related

DB Design :: How To Avoid Similar Entries In Column List In Server

Sep 16, 2015

I am sharing one sql query and o/p:

select distinct  case 
          when LastStatusMessageIDName = 'Program completed with success' then 'Office 2013 SP1 Installed Successfully'
          when LastExecutionResult = '2013' then 'Machine Does not have Office 2013'
          when LastExecutionResult = '17023' then 'User cancelled installation'
          when LastExecutionResult = '17302' then 'Application failed due to low disk space.'

[Code] .....

The below is the output for the given query,here i want to see only one comment value in my list and the count is also sum of all where comment should be Application will be installed once machine is online(Bold columns o/p)

Comment  Machine Name
Application will be Installed once machine is Online 4
Application will be Installed once machine is Online 12
Application will be Installed once machine is Online 42
Application will be Installed once machine is Online 120
Machine Does not have Office 2013 25
User cancelled installation 32
Application failed due to low disk space 41
Office 2013 SP1 already Exist 60

I need o/p like below:in single line

Application will be Installed once machine is Online 178
Machine Does not have Office 2013 25
User cancelled installation 32
Application failed due to low disk space 41
Office 2013 SP1 already Exist 60

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved