Click here to Skip to main content
15,912,400 members
Home / Discussions / Database
   

Database

 
AnswerRe: how to get top theree salary getters from table Pin
Sylvester george2-Mar-07 0:01
Sylvester george2-Mar-07 0:01 
QuestionHow to get script of a table? Pin
NanaAM28-Feb-07 19:08
NanaAM28-Feb-07 19:08 
AnswerRe: How to get script of a table? Pin
sam#28-Feb-07 20:11
sam#28-Feb-07 20:11 
GeneralRe: How to get script of a table? Pin
NanaAM1-Mar-07 19:26
NanaAM1-Mar-07 19:26 
QuestionBasic Questions on SQL Stored Procedure Pin
Rahithi28-Feb-07 16:16
Rahithi28-Feb-07 16:16 
AnswerRe: Basic Questions on SQL Stored Procedure Pin
gauthee1-Mar-07 0:10
gauthee1-Mar-07 0:10 
Questionrelationship creation through alter table query Pin
Saira Tanwir28-Feb-07 8:56
Saira Tanwir28-Feb-07 8:56 
AnswerRe: relationship creation through alter table query Pin
Mark J. Miller28-Feb-07 10:34
Mark J. Miller28-Feb-07 10:34 
The difference between One-to-One and One-to-Many is mostly conceptual. A query for either will be exactly the same. However, it can be enforced using a combination of a Foreign Key constraint and a Unique constraint. What this will do is enforce the relationship for UPDATE, INSERT and DELETE, but again, not SELECT.

If your schema looks like this:

<br />
CREATE TABLE Table1 (<br />
 [ID] INT,<br />
 BLAH,<br />
 BLAH2<br />
)<br />
<br />
CREATE TABLE Table2 (<br />
 [ID] INT,<br />
 Table1ID INT,<br />
 BLAH,<br />
 BLAH2<br />
)<br />
<br />


Then you would create your constraints like this:

<br />
ALTER TABLE Table2 ADD CONSTRAINT FK_Table2_Table1 FOREIGN KEY(<br />
 Table1ID<br />
) REFERENCES Table1 (<br />
 ID<br />
)<br />
<br />
<br />
ALTER TABLE Table2 ADD CONSTRAINT UK_Table2 UNIQUE(<br />
 Table1ID<br />
)<br />

GeneralRe: relationship creation through alter table query Pin
Mark J. Miller28-Feb-07 10:36
Mark J. Miller28-Feb-07 10:36 
QuestiontimeStart TimeEnd Pin
bernie_01128-Feb-07 20:53
bernie_01128-Feb-07 20:53 
AnswerRe: timeStart TimeEnd Pin
sam#28-Feb-07 21:19
sam#28-Feb-07 21:19 
GeneralRe: timeStart TimeEnd Pin
bernie_01128-Feb-07 22:30
bernie_01128-Feb-07 22:30 
QuestionCube File Connection string ? Pin
_mubashir28-Feb-07 8:46
_mubashir28-Feb-07 8:46 
QuestionIncorrect Time in DateTime column with MS Access database Pin
Scott Page28-Feb-07 8:24
professionalScott Page28-Feb-07 8:24 
AnswerRe: Incorrect Time in DateTime column with MS Access database Pin
sam#28-Feb-07 20:18
sam#28-Feb-07 20:18 
GeneralRe: Incorrect Time in DateTime column with MS Access database Pin
Scott Page1-Mar-07 5:25
professionalScott Page1-Mar-07 5:25 
AnswerRe: Incorrect Time in DateTime column with MS Access database Pin
Scott Page8-Mar-07 1:53
professionalScott Page8-Mar-07 1:53 
QuestionGetting a COUNT from one table and joining it to results from another. Pin
Red_Wizard_Shot_The_Food28-Feb-07 6:13
Red_Wizard_Shot_The_Food28-Feb-07 6:13 
AnswerRe: Getting a COUNT from one table and joining it to results from another. Pin
andyharman28-Feb-07 7:04
professionalandyharman28-Feb-07 7:04 
QuestionSQL 2005 CLR trigger and TCPClient [modified] Pin
Nico Patitz28-Feb-07 4:43
Nico Patitz28-Feb-07 4:43 
AnswerRe: SQL 2005 CLR trigger and TCPClient Pin
Mark J. Miller28-Feb-07 10:26
Mark J. Miller28-Feb-07 10:26 
GeneralRe: SQL 2005 CLR trigger and TCPClient Pin
Nico Patitz28-Feb-07 22:23
Nico Patitz28-Feb-07 22:23 
GeneralRe: SQL 2005 CLR trigger and TCPClient Pin
Mark J. Miller1-Mar-07 5:43
Mark J. Miller1-Mar-07 5:43 
QuestionDispalying a blank instead of null. Pin
minkinin28-Feb-07 1:34
minkinin28-Feb-07 1:34 
AnswerRe: Dispalying a blank instead of null. Pin
kubben28-Feb-07 2:53
kubben28-Feb-07 2:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.