Ask a Question related to ASP, Design and Development.
-
Guinness Mann #1
Syntax for UNIQUE constraint?
I have an existing table:
CREATE TABLE TestQuestions (
qId int NOT NULL IDENTITY(1,1)
CONSTRAINT PK_TestQuestions PRIMARY KEY NONCLUSTERED,
testId int NOT NULL
REFERENCES Tests(testId)
ON DELETE CASCADE,
objectiveId varchar (30) NULL
qType int NOT NULL
CONSTRAINT DF_TestQuestions_qType DEFAULT (0),
)
And I'd like to add the constraint:
ALTER TABLE TestQuestions ALTER COLUMN objectiveId
CONSTRAINT U_TestQuestions UNIQUE NONCLUSTERED (testId, objectiveId)
Although obviously that's not the correct syntax. Could you tell me
what *is* the correct syntax?
Thanks,
-- Rick
Guinness Mann Guest
-
Unique Form inserting into many tables using unique id
I have a Registration Form that have 3 steps. The data could be inserted into many (4) tables. Some data corresponding to a one table (the main or... -
Adding Constraint
I need to add a constraint in some columns that aren't a FK or PK. I've already looked for it in the documentation but I haven't found yet. A... -
Adding UNIQUE constraint on NULL column
I am trying to add a unique constraint on a column that can be null. The documentation states that null is treated as non equal values but I want... -
RAISEERROR from within constraint?
It appears that RAISEERROR cannot be called from a constraint? If this is the case, how can I display a custom message when validation fails? I... -
Unique constraint
> I need to create a unique contraint on a column (WO_number) but I can't use Then I don't understand how you are going to enforce uniqueness. ... -
Guinness Mann #2
Re: Syntax for UNIQUE constraint?
Sorry about this article. I fumble-fingered the newsgroup. Should have
gone to comp.databases.ms-sqlserver!
-- Rick
In article <MPG.19f76ed7563f5c3b989700@news.newsguy.com>,
[email]GMann@dublin.com[/email] says.......> I have an existing table:
Guinness Mann Guest



Reply With Quote

