Is This A Good Database Design - Very Long

Dec 29, 2007

Hey I was wondering if you
all could help me with my database. I am very noobish as databasing and I am
not sure what I have is good or bad. This is very long since I tell you basically
what my whole site does/will do. This is in hopes that it will give you a
better understanding of how many database will work.

 

Japanese WebSite

Purpose of the site:

 

This sites intention is to help people learn the 2 basic
Japanese character sets Hiragana and Katakana.
 
Hiragana is usually used for Japanese words and contains 46 basic characters,
plus a set of special characters. Katakana is usually used for foreign words
and also contains 46 basic characters plus a special set of characters.
Hiragana and Katakana are written differently when they are written with Japanese
characters. However if you right them in romaji (this is basically writing words
as if you where writing English and does not involve using characters. This is
used for foreigners while they are learning how to write the Japanese
characters).

 

Hiragana and Katakana are pronounced exactly the same.
This site will use a quiz style format. The user will first choose from the set
of Hiragana characters then the Katakana characters. Once chosen the website
will randomly choose a character and display the Japanese symbol of it.
  The user will then write the romaji
representation in the text box provided.

 


 It will be then checked
and if the user is right they will get a new symbol. If they are wrong they
will have try again.
  The purpose for
this is for the user to get use to see how the character looks like but at the
same time writing in romaji what will be easier for them. This should make it
easier for them the next time they see the character to know how to say it.

 

Version 1
 

 

The site will go through many versions. This version I am
focusing on using C#,asp and ms sql. Later on in future versions ajax and
javascrip will be introduced and parts will be changed. Version 1 also uses CSS
and html.

 

Version 1 will contain these features.


1.       A
practice section. A user will go through a wizard like setup that will first
let them choose from the basic 46 Hiragana characters (the other special
characters will be added later). They will then go to the next setup and choose
from the 46 basic Katanana characters. After they go to another section that
asks them how many repetitions they want to go through.
  If the user is a member(free membership) they
will have the option to save their settings that will be stored and later
available on the front page called quick links. The next page of the wizard is
actually going through the quiz. Once they are done they will see a summary of
how many they got right,wrong and how many they needed assistance on. At this
point they will be able to view a chart to see their progress(current chart
showing there last
  attempt, a week one
and a month one). These charts will be either made using c# or ms sql(I saw a
something that says you can make something like that but have not confirmed
it). I may do both ways for a learning experience.


2.       A
  Registration form, login and logout.


3.       Quick
link. Quick link will be for registered members so they don’t have to go
through the wizard every time to make their practice quiz up. A user will go
through the wizard once and choose what they want and save it.
  Quick link will be on all the pages in the
form of mostly likely a grid view. A user will be able to store 3-5 different quiz’s
(in the future maybe more). A user can then click on the quick link and it will
just take them to the quiz. The user will also will be able to update their
quiz through the grid view. This will take them to the start of the wizard and
they can go through it again and then just save over it. They will also be able
to delete there quick links through the grid view.

Currently done

Half of step 1 has been completed. Currently a user can
go through the wizard and select what they want and choose how many repetitions
and go through the quiz. However the summary and charts are not done.

 

Future versions.

 

Design will be a major part of it since I have not
focused on this at all. Also since I wanted to experiment with dynamic controls
I made all the checkboxes for the selections dynamically. This caused a problem
that a user must hit a save button since the controls have to get recreated and
updated.

 

I think normally this might not have been a problem but
since I since I am using a multiview(to create a effect that the wizard is all
on the same page and not the whole page has to be reloaded) it caused some
problems(I can’t really remember since it was a couple months ago when I
started but had to stop due to the amount of school work). This is why I want
to go back later and make them with ajax. This also makes another learning
experience.

 

Where I am at now.

 

When I started this I really did not think much of my
database mainly because I am not good at data basing and don’t really like it that
much. I have had a course in data basing (was with oracle though)that was part
of my program. At the time I did not understand very much since I found the
teacher going too fast and he started at chapter 8….. Also when you got 7 other
courses with it it’s hard to learn lots.

 

I have gone through some tutorials and stuff. I am not
very keen on reading a database book since I just don’t have the time since I
want to also read a book on c#, javascript, ajax and so forth. Also I don’t
know how much I will retain/learn from a book. With some of the stuff I just
find its better to try to something where you will be interested in and then
when needed read chapters of a book or ask questions.
  This is what I done for my c# stuff like I
had a c# with asp course and 2 months after the courses I started this site and
I had to ask myself what the heck did I learn in that course since it seemed I
knew nothing(and I was close to top in my class). With pounding it out and
reading I was able to accomplish what I needed. Like I still want to read a
book on C# but for now it’s just not going to happen same with Data basing.

 

All the pervious information was so you can understand
what my website is trying to do so you can better evaluate my database design
and answer my questions.

 

First Design of my
database.

 

This is when I just made it up on the spot and did not do
any database design or anything.

 

Question 1: I
forgot how to limit select query results. Like If I just want to show 10 query
results how do I do this?

 

I have currently 2 tables How one called Hiragana and the
other Called Katakana

 

HiraganaID = PK

 

HiraganaID
  HiraganaCharacter HiraganaImage

----------- -----------------
--------------------------------------------------

1
           a
                 Images/hiragana/a-o/a.jpg

2
           i
                 Images/hiragana/a-o/i.jpg

3
           u
                 Images/hiragana/a-o/u.jpg

4
           e
                 Images/hiragana/a-o/e.jpg

5
           o
                 Images/hiragana/a-o/o.jpg

6
      
    ka
                Images/hiragana/ka-ko/ka.jpg

 

Katakana

 

KataKanaID = PK

 

KatakanaID
  KatakanaCharacter
                                  KatakanaImage

-----------
-------------------------------------------------- --------------------------------------------------

1
           chk_Kata_a
                                        
Images/katakana/a-o/a.jpg

2
           chk_Kata_i
                                        
Images/katakana/a-o/i.jpg

3
           chk_Kata_u
    
                                    Images/katakana/a-o/u.jpg

4
           chk_Kata_e
                                        
Images/katakana/a-o/e.jpg

5
          
chk_Kata_o
                                        
Images/katakana/a-o/o.jpg

 

I quickly found that this design was very bad since I was
unable to add new rows very easily. Each character set has each of its characters
in rows of 5. Some rows however have only 3 romaji characters so what they do
is leave the other cells blank representing that they don’t exist. I wanted to
do this too so I figured the easier way would be to have just null rows of
data. So say for “ya,yu,yo� it would be like this “ya,null,yu,null,o�. That’s
how it would appear in the database so when my c# would read it in it would not
have to account for rows that had less than 5 characters since it would have
already the nulls for it.

 

You can check a chart out here: http://www.alpha.ac.jp/japanese/img/moji.gif

 

So with this poor design it would result me in basically
rewriting the database.

 

I have thought of 2 possible ways to. I am not sure if
either way is good but I will try to explain my reasoning as much as I can.

 

Possible Way 1

 



 

In this approach I have 5 tables.

 

 

 

 

 

Hiragana

This table stores all the information about Hiragana
Characters

 

CREATE TABLE [dbo].[Hiragana](


      [HiraganaID] [int] IDENTITY(1,1) NOT NULL,


      [HiraganaCharacter] [varchar](5) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL,


      [HiraganaImage] [varchar](50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL,


      [SortOrder] [numeric](3, 0) NOT NULL,


 CONSTRAINT [PK_Hiragana] PRIMARY
KEY CLUSTERED

 

 

 

Katakana

This table stores all the information about Katakana
Characters

 

CREATE TABLE [dbo].[Katakana](


      [KatakanaID] [int] IDENTITY(1,1) NOT NULL,


      [KatakanaCharacter] [varchar](50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL,


      [KatakanaImage] [varchar](50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL,


      [SortOrder] [numeric](3, 0) NOT NULL,


 CONSTRAINT [PK_Katakana] PRIMARY
KEY CLUSTERED

 

 

Quick Links

This table will store the users quick link information.

 

CREATE TABLE [dbo].[QuickLinks](


      [QuickLinkName] [varchar](50) COLLATE
SQL_Latin1_General_CP1_CI_AS NOT NULL,


      [UserID] [int] NOT NULL,


      [SavedCharacters] [varchar](200) COLLATE
SQL_Latin1_General_CP1_CI_AS NOT NULL,


      [SavedImagePaths] [varchar](200) COLLATE
SQL_Latin1_General_CP1_CI_AS NOT NULL

) ON [PRIMARY]

 

Users

This will store login information.

CREATE TABLE [dbo].[Users](


      [UserID] [int] IDENTITY(1,1) NOT NULL,


      [UserName] [varchar](30) COLLATE
SQL_Latin1_General_CP1_CI_AS NOT NULL,


      [EmailAddress] [varchar](50) COLLATE
SQL_Latin1_General_CP1_CI_AS NOT NULL,


      [Password] [varchar](50) COLLATE
SQL_Latin1_General_CP1_CI_AS NOT NULL,


      [DateTimeStamp] [smalldatetime] NOT
NULL,


 CONSTRAINT [PK_Users] PRIMARY
KEY CLUSTERED

 

Charts

This will store all information that will be used for
charts.

 

CREATE TABLE [dbo].[Charts](


      [PracticeNum] [int] IDENTITY(1,1) NOT NULL,


      [UserID] [int] NOT NULL,


      [Correct] [numeric](3, 0) NOT NULL,


      [Wrong] [numeric](3, 0) NOT NULL,


      [AssitanceNeeded] [numeric](3, 0) NOT NULL,


      [TimeDateStamp] [smalldatetime] NOT
NULL,


 CONSTRAINT
[PK_Charts] PRIMARY KEY
CLUSTERED

(

 

 

Relationships

 

Users and QucikLinks have a PK to FK relationship this is
because quicklinks is dependent on the user having a user account. It also away
to identify which QuickLinks will belong to who.

 

Question 2:
  Currently I don’t have a primary Key for this
table what would be a good primary key for this table?

 

QuickLinks also does not have any relationship to either
to HiraganaCharacters or Katakana Characters. This is because I did not feel it
was necessary to grab the information from here. I simply could just grab it
from the array that holds this information from my c# code.

 

Question 3:
  How can I make this table for all users? Like
Say they choose 5 characters and save it as QuickLink1(as the
QuickLinkName).
  Should each of these 5
characters gets its own line or should it all be saved in one row? Or should I
even have another table to hold this data?

 

Option 1

 

QuickLinkName
     UserID
     
SavedCharacters
  
 SavedImagePaths
                                                                                                                                                                              

   

---------------- ----------- ------------------- --------------------------

QuickLink1
         1
     
              a
     
     image/a.jpg

QuickLink1
         1
     
              i
     
     image/i.jpg

QuickLink1
         1
     
              u
     
     image/u.jpg

QuickLink1
         1
     
              e
     
     image/e.jpg

QuickLink1
         1
     
              o
     
     image/o.jpg

QuickLink1
         2
     
              a
     
     image/a.jpg

QuickLink1
         2
     
              ya
    
     image/ya.jpg

QuickLink1
         2
     
              ki
    
     image/ki.jpg

QuickLink1
         2
     
              yo
    
     image/yo.jpg

QuickLink1
         2
     
              n
     
     image/n.jpg

























 




Option 2

 


             
 

QuickLinkName
     UserID
     
SavedCharacters
  
 SavedImagePaths
                                                                                                                                                                              

   

---------------- ----------- ------------------- --------------------------

QuickLink1
         1
     
              a,i,u,e,o
     image/a.jpg, image/i.jpg,


                                        
      image/u.jpg, image/e.jpg,


                                                image/o.jpg,


                    
      

QuickLink2
   
   
 2
             
   a,ya,ki,yo,n
      image/a.jpg,
image/ya.jpg,


                                        
      image/ki.jpg, image/yo.jpg,


                                                image/n.jpg,


             

Charts table also has a Relationship with Users

 

The thinking for this one is that Charts will use the
UserID to tell who this data belongs too. It will store the number of correct
answers, wrong answers and AssitanceNeed. This table will also hold a timeDateStamp.
The reason for this is because I want to have a chart that displays the last
Quiz they did and also the stats of a week’s worth of quizzes, and month’s
worth of quiz’s. With a timeDateStamp I should be able to add up all those columns
and then display them for whatever period I choose.

 

Second Possible
Way.

  

Characters

 

CREATE TABLE [dbo].[Chracters](


      [CharacterID] [int] NOT NULL,


      [CharacterName] [varchar](5) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL,


      [CharacterPath] [varchar](50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL,


      [SortOrder] [numeric](3, 0) NOT NULL,


 CONSTRAINT [PK_Chracters] PRIMARY
KEY CLUSTERED

 

This way uses 4 charts instead of 5. The main difference
is that the Hiragana Charts and Katakana Charts have been merged into one
table.

 

This way has another relationship between Characters and
Quick Links.
  This will store the Character
ID instead of the actual Characters and Path through the use of C# code. When a
user selects a box it will make a note of the CharacterID. When it is time for
the user to use the QuickLink it will join the tables together and filter out
the CharacterIDs. Giving me the CharacterName and Path.

 

The problem with this way is that well the code I written
will need to be changed since currently it grabs stuff from 2 tables into one.
I don’t know if this would save anytime over the first way either.

 

I hope these are sort of close to an alright design since
I did try to think about how my website would interact with the database.

 

Sorry for it being so long.

 

Summary of Questions

 

Question 1: I
forgot how to limit select query results. Like If I just want to show 10 query
results how do I do this?

Question 2:
  Currently I don’t have a primary Key for this
table what would be a good primary key for this table?

Question 3:
  How can I make this table for all users? Like
Say they choose 5 characters and save it as QuickLink1(as the
QuickLinkName).
  Should each of these 5
characters gets its own line or should it all be saved in one row? Or should I
even have another table to hold this data?

 

View 9 Replies


ADVERTISEMENT

Good Table Design...

Jul 20, 2005

Hello,I am designing a table of vehicle types, nothing special, just a list ofunique vehicle types such as truck, lorry, bike, motor bike, plane, tractoretc etcFor the table design I am proposing a single column table with a field namecalled vehicle_type and this will contain the vehicle type.Sot it will bevehicle_typecarbiketractorplanetruckvanblahblahblahIs this ok? Or is there a better way to do it?Thanks,td.

View 36 Replies View Related

Why Does The Merge Join Edit Control Take So Long To Close At Design Time?

May 14, 2008



When I'm designing a merge join in BIDs, in particular a large one with say a couple hundred columns on the left part of the join (and only 1-2 columns on the right side), it takes 2-3 minutes to close and I notice it pegs the CPU on the computer during that time. I'm developing on a quad dual core 64 bit machine with 32 Gb of RAM.


What makes this problematic is if you have a several merge joins in the pipe, and you do something like add a column. Then you have to re-open every merge join to include that column, waiting 2-3 minutes for it to close. So adding a column to a pipe with 10 merger joins will take 20-30 minutes, most of which is just waiting for edit boxes to close. I've tried the options of "work offline" and setting the ValidateExternalData to false in the merge join property but those don't help. Anyone encounter this problem?

Thanks,
Lee

View 6 Replies View Related

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

Upgrading A Database (good Practice)

Mar 5, 2008

hi experts,
i have a postcode database that i need to update. the database cnotains of 6tables, the file i ahev has all the information at once, so i have to organize it and insert records into the appropriate tables.
this is the first time i'm doign this so i would like to know what the best way to do? do i need to create a stored procedure or a script, or may be something special and efficient that i do not know yet.
any advise will be very appreciated
thanks in advance

View 1 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

Script Out The Entire Database Objects - Is There A Good Way?

Jul 27, 1998

After found out the `transfer object` command in MS SQL EM didn`t work well
in my databases, I started code by myself to generate the `Create xxx` statements to copy objects across databases (structure only) using SQL.

I`ve coded out most of them, logins, defaults, UDT, tables, stored procedures,
but then I started to have problems with primary keys and foreign key const.

Has anyone tried to do the same thing before or is there some SQL scripts created to handle this already? Please advise me.

I am thinking to use SQL-DMO with VBscript now. But I still prefer a good
SQL script (old thought, the DB-Lib based `isql` is more reliable than the
SQL-OLE).

Thanks for any suggestion.

- Ken

View 3 Replies View Related

Multiple Database Files: Good Or Neutral?

Sep 12, 2007



I have inherited some responsibilities for which I'm not really qualified, so I'll push on through and maybe not totally fall down.

Assume 10 50GB databases, each in a single MDF file. All these MDF files reside on the C drive (the only drive on the system), running SQL 2005 in a 32-bit Windows 2003 or later, 8GB RAM.

The C drive is 6 physical disks in RAID 5, say about 1.0 TB or so. We have 4 dual-core processors on the box.

We have limited simultaneous users, initally about 8 users doing very heavy write on all tables in any one database. Later, we have about 15 users connecting via Web interface, and doing very heavy read and light writing. Each of the 10 or so database has this lifecycle: Heavy write for about 2 weeks (load data) then heavy read for about 1 month (research and search data), then nothing ever again (db is taken offline).

Of course, this is not enough information to go on, but let's just go on it anyway.

My TempDB, Log (simple recovery), Index etc is all on the same RAID 5 drive (C).

I have two basic questions I'd love to hear feedback on:
1. Is there any real advantage to creating 8 Data files for my database (one per processor core)?
2. Given that the hardware people here REALLY don't want to change anything, what should I fight for first:

a. Separate drive for LOG files?
b. Separate drive for TempDB?
c. Something else


Thanks in advance.

View 1 Replies View Related

What Is A Good Tool For Modeling A SQL Server 2005 Database?

Nov 20, 2006

Hello,

I need a tool that will let me model a SQL Server 2005 database and then generate the tables, constraints, etc. from the model. I've never used a modeling tool so my knowledge is quite limited. I don't need to model or reverse engineer an application - my sole concern is on the SQL Server database side. I'm not concerned if the tool integrates with Visual Studio. And, of course, price is one consideration.

Are there any good tools that I should look at?

Thanks,

BCB

View 3 Replies View Related

Is Databinding A Good Option In ASP .net To Manage Huge Database...?

Mar 13, 2008

I am actually a newbie to asp.net and i m using ASP.net 3.5 i.e, VWD 2008. i am using it for the first time as my tool to develop a website for my final year project. i am planning to develop an online job recruitment site like www.monster.com. Rigth now i am confused how will i manage my database. i've learned to use databinding concept of SQL SERVER in VWD 2008 but will it be enough to handle such huge # of Job postings and employers and as well as Resumes in pdf of word format? or do i have to create a separate databse in SQL Server and to connect it with my website? i am confused at the moment. please help me in this matter.
Regards,
Jigzy

View 6 Replies View Related

Long Time Database Processing In ASP.NET ?

Aug 2, 2007

 I made a website in ASP.net and using sql server 2005 as database. There is sometime processing data that need long time processing ( about 20 minutes ) and big data. It works fine in dev box, but when I place on shared hosting, and some people access it  crashed. The website can not be accessed. Hosting support told me maybe I need to reprogram my code. So anybody has solution for this problem ? Should I create new thread ?  

View 3 Replies View Related

Using DTS To Copy One Database Into Another... How Long Should It Take? 1.5 Gigs

Sep 29, 2004

i'm using DTS to copy one database into a new database, copying over everything, i.e. stored procedures, views, etc.. not just the tables.. how long should it take? it's been stuck at 22% now for about 15 minutes?

thanks

View 2 Replies View Related

Database Search Time -too Long

Jun 2, 2008

I had a database of electronic resources which had 28000 records earlies and was working fine. Now we have added a whole bunch to make it 800K records which has increased the search time to 14-22 seconds which is not acceptable. I have all the tables indexed.

Please help me how to solve this problem. Let me know what other information I should put up here to make my problem undestandable.
Thanks in advance,
Archana

View 2 Replies View Related

How Long To Copy/replicate A Database

Jul 20, 2005

My company is considering purchasing MS SQL Server to run anapplication on (SASIxp). I am mainly familiar with Oracle, so I waswondering how long it would take to copy a database. Basically we havedatabase A and each night we want to replace database B with thecontents of A. How long would this take say if we had a 10GB databaseor a 20GB database.What would be the technique to do this nightly, the Copy DatabaseWizard, Snapshot Replication, Attach & Detach...? We need to automatethis process, and the source database can be made unavailable whenthis happens.Thanks,Roger

View 2 Replies View Related

Shrink Database Takes Too Long (days)

Dec 14, 2007

I have a database with 2 almost identical tables.
Each one is about 1.2 Billion rows, 0.5 Tb each.
I've truncated one of them and started SHRINK DB WITH REORGANIZE PAGES
It is running already for 3 days.
When should I start to worry :)

Thank you in advance

View 3 Replies View Related

How Long Need ALTER DATATABLE (DATABASE) SET ENABLE_BROKER ?

Dec 21, 2005

I am try to start with SQL BROKER service,

When I lunch from sql Management studio the following query, this don't finish never.

ALTER DATATABLE dbname SET ENABLE_BROKER

 

Where I am mistaking ?

 

View 11 Replies View Related

DB Design :: Buffer Database - Insert Information From Partners Then Make Update To Main Database

Oct 29, 2015

I actually work in an organisation and we have to find a solution about the data consistancy in the database. our partners use to send details to the organisation and inserted directly in the database, so we want to create a new database as a buffer database to insert informations from the partners then make an update to the main database. is there a better solution instead of that?

View 6 Replies View Related

<Long Text> Appears From Access Database Import

May 15, 2001

When I import data from MS Access databases, some fields appear as
"<Long Text>" in SQL. I cannot edit these fields in SQL. I have to export
the table to Access, update the field, and then import again.

There's got to be an easier way. What am I missing here?

The field in Access is of type 'memo'.

View 1 Replies View Related

Master Database Rebuild Takes Long Time

Dec 17, 2007

Hi All,

I'm trying to rebuild my master database for sql server 2000. The process of rebuilding stared fine. But it is almost 4 hours since it got started. Performing it on a test system. Got doubtful and started the same on another test system. Issue is same and it is almost 2 hours. The Db size is less than 100 MB in both cases. IS IT NORMAL? I've tried the same for SQL SERVER 2005 and it got finished in couple of minutes. Please advise.

View 5 Replies View Related

Remote Database Updates Take Long Time To Complete

Jul 20, 2005

HiI have have two linked SQL Servers and I am trying to get remote writesworking correctly (fast).I have configured the DB link on both machines to:Point at each others DB.I have security set up to map each others server loginsand Server Options: Collation Compatible, Data Access, RPC, RPC Out, UseRemote Collation all checkedMy problem is that when a SP performsBegin TransactionUpdate Local TableUpdate Remote TableCommit TranIt takes several seconds to complete. (about 7 seconds not acceptable tous)This is due to the remote update - how can I improve the response time?example of a stored procedures that takes timewhere ACSMSM is a remote (linked) SQL Server.procedure [psm].ams_Update_VFE@strResult varchar(8) = 'Failure' output,@strErrorDesc varchar(512) = 'SP Not Executed' output,@strVFEID varchar(16),@strDescription varchar(64),@strVFEVirtualRoot varchar(255),@strVFEPhysicalRoot varchar(255),@strAuditPath varchar(255),@strDefaultBranding varchar(16),@strIPAddress varchar(23)asdeclare @strStep varchar(32)declare @trancount intSet XACT_ABORT ONset @trancount = @@trancountset @strStep = 'Start of Stored Proc'if (@trancount = 0)BEGIN TRANSACTION mytranelsesave tran mytran/* start insert sp code here */set @strStep = 'Write VFE to MSM'updateACSMSM.msmprim.msm.VFECONFIGsetDESCRIPTION = @strDescription,VFEVIRTUALROOT = @strVFEVirtualRoot,VFEPHYSICALROOT = @strVFEPhysicalRoot,AUDITPATH = @strAuditPath,DEFAULTBRANDING = @strDefaultBranding,IPADDRESS = @strIPAddresswhereVFEID = @strVFEID;set @strStep = 'Write VFE to PSM'updateACSPSM.psmprim.psm.VFECONFIGsetDESCRIPTION = @strDescription,VFEVIRTUALROOT = @strVFEVirtualRoot,VFEPHYSICALROOT = @strVFEPhysicalRoot,AUDITPATH = @strAuditPath,DEFAULTBRANDING = @strDefaultBranding,IPADDRESS = @strIPAddresswhereVFEID = @strVFEID/* end insert sp code here */if (@@error <> 0)beginrollback tran mytranset @strResult = 'Failure'set @strErrorDesc = 'Fail @ Step :' + @strStep + ' Error : ' + @@Errorreturn -1969endelsebeginset @strResult = 'Success'set @strErrorDesc = ''end-- commit tran if we started itif (@trancount = 0)commit tranreturn 0

View 2 Replies View Related

Cache Database Structure (How To Detect If Database-design Has Changed..)

Feb 24, 2006

Hello everyone,I have a webcontrol that uses database-structures alot, it uses the system tables in SQL to read column information from tables. To ease the load of the SQL server I have a property that stores this information in a cache and everything works fine.I am doing some research to find if there are anyway to get information from the SQL server that the structure from a table has changed.I want to know if a column or table has changed any values, like datatype, name, properties, etc.Any suggestions out there ?!

View 3 Replies View Related

Designing A Database Within A Database... Design Question Storing Data...

Jul 23, 2005

I have a system that basically stores a database within a database (I'msure lots have you have done this before in some form or another).At the end of the day, I'm storing the actual data generically in acolumn of type nvarchar(4000), but I want to add support for unlimitedtext. I want to do this in a smart fashion. Right now I am leaningtowards putting 2 nullable Value fields:ValueLong ntext nullableValueShort nvarchar(4000) nullableand dynamically storing the info in one or the other depending on thesize. ASP.NET does this exact very thing in it's Session State model;look at the ASPStateTempSessions table. This table has both aSessionItemShort of type varbinary (7000) and a SessionItemLong of typeImage.My question is, is it better to user varbinary (7000) and Image? I'mthinking maybe I should go down this path, simply because ASP.NET does,but I don't really know why. Does anyone know what would be the benifitof using varbinary and Image datatypes? If it's just to allow saving ofbinary data, then I don't really need that right now (and I don't thinkASP.NET does either). Are there any other reasons?thanks,dave

View 7 Replies View Related

Knowledgeable Yet Simple Book For Database Modelling Or Database Design

Aug 16, 2007

Hi All,Can u please suggest me some books for relational database design ordatabase modelling(Knowledgeable yet simple) i.e. from which we couldlearn database relationships(one to many,many to oneetc.....),building ER diagrams,proper usage of ER diagrams in ourdatabase(Primary key foreign key relations),designing smallmodules,relating tables and everything that relates about databasedesign....Coz I think database design is the crucial part of databaseand we must know the design part very first before starting up withdatabases.....Thanks and very grateful to all of you....Vikas

View 3 Replies View Related

SQL Server Admin 2014 :: Restore Database From GUI Takes Long Or Never Pop Up

Mar 24, 2015

I have SQL 2014. When I try to restore a user database using SSMS GUI, the Restore Database Pop up box never pops up. This happens for any database on this server at any time. Sometimes I get the pop up, some times I dont get.

So I tried to click on Databases on Top and Restore Database, and then select the db that I need to restore from Drop down, then it shows "creating restore plan selecting backups" but it takes forever.

We have full backup and trn log backups every 30 mins. So is it trying to get all these backup files in the background causing this issue? If yes then how to overcome this?

View 4 Replies View Related

DB Engine :: Impact On Database If Stop A Long Running Rebuild Index Job?

Apr 26, 2015

We have 3 maintenance jobs configured in this particular DB instance:

Daily backup of system database - SubPlan1 (Check Database Integrity Task --> Rebuild Index Task-->Backup Database Task)Daily backup of user databases - Five subplans for each task : (Check DB integrity --> Rebuild Index -->Backup User Database, Backup Log -->Cleanup History)Weekly maintenance - SubPlan1 (Check Database integrity job (system+user DB) + rebuild index job (system+user DB) )

PROBLEM: I just noticed that the User DB Rebuild Index task has been running since the 03/04 and the Weekly maintenance plan - subplan1 since the 12/04.

Which job is "safe" to stop without impacting the database?

View 14 Replies View Related

Database Design- Referencing Multiple Database

Sep 27, 2007

Hi All,
I am designing database where few of the master tables will reside in different database or in case different server. Scenario is
Server "A" with Database "A" may host the "Accounts" table.
Server "B" with Database "B" may host the "Product" table.
I am designing database "Project" which will hosted in Server "A".
My application requires this master tables [readonly access] as data inserted in my application refers this tables. Also there are reports to be generated which refer this tables.
How do i design my database and sql queries?
I am thinking of approach of having equivalent tables created in my database and writing service which keep tables in my database in sync. This will ensure good perfomance during transaction and reports as they will need to refer this table locally as opposed to different database or different server.

Any thoughts on above approach?? or any better/standard way for such scenarios ?

Thanks in Advance. Your inputs will be of great help.

View 14 Replies View Related

Database Design - Multiple Vs. Single Database

Apr 12, 2007

Hello:

My client has a db with the following structure:

Online US Searchable Map of the 50 US States. Users search criteria is the following: Query records by selecting state, county, then record. Each County table has 10-20 tables. All databases combined = 500MB and TLogs = 100MB.

How would you re-design a relational DB where users could query data by state-county-record. Currenty the DB's are created by the County of each state which creates hundreds of DB's in SQLServer with no realtionship to each US state. What would be the best design to ensure good performance, data integrity and maintenance? Would you create 1 DB with all 50 states, create 4 DB's and divide by region(N,S,E,W), 50 DB's of each state or leave it as is with each county it's on DB? Any suggestions would be appreciated.

thx
rob

View 7 Replies View Related

Database Design???

Oct 20, 2006

Hello, I am designing my first database with 5 tables for a demo project and am not sure if it works. an example below.2 of the many things I want visitors to the site to do is find a company by the industry sector they belong to,..andwhat sort of service or products they can supply. For instance a Employment agency maybe under professional services  Table 1 Customer Customer_ID = primary key,,,, Sector_ID = Foreign keyComapany Name, Address, Phone, Postcode etcTabel 2 Industry SectorsSector_ID = primary key,,,,Customer_ID= foreign key banking, Education,Prof Services, etc  Table 3  Trading ActivityTrading_ID = primary key,,,,Sector_ID =  Foreign key, Products_ID= FkEmployment Agent, School, Lawyer etcTable 4 ProductsProducts_ID = primary key,,,,Trading_ID = foreign keySupply frozen foods, transport services, sports goods, etc  Table 5 Account Account_ID = primary key,,,,Customer_ID = foreign keyAccount Name, Credit Limit, Payment Terms, Open date, Account contact etc  One big point of confusion is, can I have the Customer_ID from the principal Customers tablein every table as a foreign key or must the tables be chained together one after the other as such. Advice appreciatedThanks 

View 1 Replies View Related

Database Design

Apr 10, 2007

Hi,
 I need a hand with designing a database.
 I am collecting results from a survey which has the following questions:
Call ref? How did you place your support call?  Were you satisfied with the amount of time you had to wait until getting acknowledgement of the support call placed? 1 = very satisfied and 10 = very unsatisfied.  How happy were you with the customer service you received upon placing the support call?   1 = very unhappy and 10 = very happy.How satisfied were you with the amount of time you had to wait until you heard from an engineer? 1 = very satisfied and 10 = very unsatisfied.   How satisfied were you with the time taken to get your problem/query resolved? 1 = very satisfied and 10 = very unsatisfied  Did you feel the engineer had enough knowledge to deal with your call? 1 = very good and 10 = not very good  Overall how satisfied were you with the support call placed? 1 = very satisfied and 10 = very unsatisfiedIs there anything we can do to improve the quality of the support and service you received?
I want to store this in a database.  Obviously I want to use best practice for design, normalisation etc.  The stumbling block I am coming accross is the fact that each question has a number and each question has a score from 1 to 10 and storing this in the database.  Any help appreciated!
Thanks
Andrew 
 

View 9 Replies View Related

Database Design

Apr 26, 2007

I am creating database tables for company testimonials.  Database columns: name, position, companyname, comment, service we provided. 
My question is that for each company - may have a multitude of different services from us, and different people with different positions in the same company may make comments.
What is best practice for putting this db structure together?
Thanks
Andrew

View 1 Replies View Related

Database Design

Oct 29, 2007

 Can anyone tell me how can i design database architecture for the Table Category & Product...so that i can make N-level entity relation....I have database in SQL SERVER 2000. 

View 2 Replies View Related

Need Help With Database Design.

Jan 30, 2008

I guess I am confused about something and need some help. I am looking at a database schema for about 20 tables in a database. I noticed that the firstcolumn in each table Is some type of Id. For example StudentId,TestId etc.Where the Id is a unique numeric sequential value.
So I have some questions?1- Do these Id's act as what are called indexes for the table?(Unique indexes)2- If the answer to 1 is correct, then how do I create these unique indexes?   Is it as simple as declaring the Id column as the primary key and that this   value will be generated automatically upon insert? 3- Is it necessary to have an Id column for every table, or may I only do it   for a few of them?4. In relation to Question2, what do I need to do, so that the Id column will   automatically be created when someone inserts a value into the database    table with an ID column.
For example here are two sample tables
StudentsInfo
StudentId<PK>   Name   Age 1               Mark   33 2               Jill   23   3               Mary   25
PersonalInfo
Name<FK>  SocialSecurity   Address    MajorMark      324-444-3342      15 Elm    ArtJill      888-888-8998      21 North  ScienceMary      876-777-2344      18 Byle   Music

View 6 Replies View Related

Database Design

Apr 17, 2008

Hi,I am planning to create a technical forum for our college. could any one give me an idea of how to design the database for the forum. what table and columns i should have? 

View 4 Replies View Related







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