Click here to Skip to main content
16,005,682 members
Home / Discussions / Database
   

Database

 
QuestionFile format for data export/import Pin
petrveit10-Aug-08 8:56
petrveit10-Aug-08 8:56 
AnswerRe: File format for data export/import Pin
Mycroft Holmes10-Aug-08 16:36
professionalMycroft Holmes10-Aug-08 16:36 
GeneralRe: File format for data export/import Pin
petrveit10-Aug-08 19:11
petrveit10-Aug-08 19:11 
GeneralRe: File format for data export/import Pin
Mycroft Holmes10-Aug-08 20:20
professionalMycroft Holmes10-Aug-08 20:20 
QuestionDatabase Design Question - Table(s) for limiting user choices in a main table [modified] Pin
Elgin Rogers10-Aug-08 3:01
Elgin Rogers10-Aug-08 3:01 
AnswerRe: Database Design Question - Table(s) for limiting user choices in a main table [modified] Pin
Wendelius10-Aug-08 3:37
mentorWendelius10-Aug-08 3:37 
GeneralRe: Database Design Question - Table(s) for limiting user choices in a main table Pin
Elgin Rogers10-Aug-08 4:08
Elgin Rogers10-Aug-08 4:08 
GeneralRe: Database Design Question - Table(s) for limiting user choices in a main table Pin
Wendelius10-Aug-08 4:49
mentorWendelius10-Aug-08 4:49 
Yes, that seems clear. This is a bit problematic situation in SQL Server, since it does not allow multiple modifying references between same tables. Only NO ACTION is allowed several times. For example:
CREATE TABLE Choice (
[Choice] int not null,
[Type] int,
[Name] varchar(50));
ALTER TABLE CHOICE ADD CONSTRAINT pk_Choice PRIMARY KEY ([Choice]);

CREATE TABLE Doc (
[Doc] int not null,
[Status] int,
[Dept] int);
ALTER TABLE Doc ADD CONSTRAINT pk_Doc PRIMARY KEY ([Doc]);
ALTER TABLE Doc ADD CONSTRAINT fk_Doc_Status FOREIGN KEY ([Status]) REFERENCES Choice ([Choice]) ON DELETE SET NULL;
ALTER TABLE Doc ADD CONSTRAINT fk_Doc_Dept FOREIGN KEY ([Dept]) REFERENCES Choice ([Choice]) ON DELETE SET NULL; -- This fill fail because of the limitation
ALTER TABLE Doc ADD CONSTRAINT fk_Doc_Dept FOREIGN KEY ([Dept]) REFERENCES Choice ([Choice]) ON DELETE NO ACTION; -- However since this is restricting, it will work

What I would suggest is that you use triggers to enforce this kind of referential integrity. Of course you can use declarative constraints on some of the columns, but not on all of them.

Hope this helps,

Mika
AnswerRe: Database Design Question - Table(s) for limiting user choices in a main table Pin
Elgin Rogers10-Aug-08 10:34
Elgin Rogers10-Aug-08 10:34 
GeneralRe: Database Design Question - Table(s) for limiting user choices in a main table Pin
Wendelius10-Aug-08 11:18
mentorWendelius10-Aug-08 11:18 
AnswerRe: Database Design Question - Table(s) for limiting user choices in a main table Pin
Mycroft Holmes10-Aug-08 16:30
professionalMycroft Holmes10-Aug-08 16:30 
Questiondate format and change from gregorian date to hijri date Pin
kimo code9-Aug-08 21:02
kimo code9-Aug-08 21:02 
AnswerRe: date format and change from gregorian date to hijri date Pin
Wendelius9-Aug-08 23:02
mentorWendelius9-Aug-08 23:02 
AnswerRe: date format and change from gregorian date to hijri date Pin
Jerry Hammond10-Aug-08 4:58
Jerry Hammond10-Aug-08 4:58 
Questionbetween and like condition Pin
kimo code9-Aug-08 19:54
kimo code9-Aug-08 19:54 
AnswerRe: between and like condition Pin
PIEBALDconsult9-Aug-08 20:03
mvePIEBALDconsult9-Aug-08 20:03 
GeneralRe: between and like condition Pin
kimo code9-Aug-08 20:17
kimo code9-Aug-08 20:17 
AnswerRe: between and like condition Pin
Wendelius9-Aug-08 23:00
mentorWendelius9-Aug-08 23:00 
GeneralRe: between and like condition Pin
kimo code10-Aug-08 20:01
kimo code10-Aug-08 20:01 
GeneralRe: between and like condition Pin
Wendelius11-Aug-08 5:43
mentorWendelius11-Aug-08 5:43 
AnswerRe: between and like condition Pin
Peter Appleby19-Aug-08 7:08
Peter Appleby19-Aug-08 7:08 
GeneralRe: between and like condition Pin
kimo code19-Aug-08 19:39
kimo code19-Aug-08 19:39 
Questionsql server 2000 to sql server 2005 Pin
Rameez Raja9-Aug-08 16:55
Rameez Raja9-Aug-08 16:55 
AnswerRe: sql server 2000 to sql server 2005 Pin
Paul Conrad9-Aug-08 19:27
professionalPaul Conrad9-Aug-08 19:27 
QuestionSQL Server 2000,Multivalued Attributes Pin
amit20119-Aug-08 5:40
amit20119-Aug-08 5:40 

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.