Вопрос по sql-server, sql, sql-server-2008 – Изменение таблицы и добавление уникального ключа приводит к ошибке

3

Error: User Rate Limit ExceededAnimal. AnimalIdError: User Rate Limit ExceededAnimalType_idError: User Rate Limit ExceededAnimalTypeError: User Rate Limit Exceeded

ALTER TABLE Animal
ADD UNIQUE Animal.AnimalType_id int

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Msg 102, Level 15, State 1, Line 2
Incorrect syntax near '.'.

Error: User Rate Limit Exceeded TechGuy
Error: User Rate Limit Exceeded Conrad Frix
Error: User Rate Limit Exceeded TechGuy
Error: User Rate Limit Exceeded Daniel Renshaw

Ваш Ответ

4   ответа
14

Error: User Rate Limit ExceededError: User Rate Limit ExceededError: User Rate Limit Exceeded

ALTER TABLE Animal ADD CONSTRAINT UQ_Animal_AnimalTypeId UNIQUE (AnimalType_id)

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

ALTER TABLE Animal
    ADD CONSTRAINT FK_Animal_AnimalType
    FOREIGN KEY
    (
        AnimalType_id
    )
    REFERENCES AnimalType
    (
        id
    )

Error: User Rate Limit Exceeded

Error: User Rate Limit ExceededCONSTRAINTError: User Rate Limit Exceeded
Error: User Rate Limit ExceedednameError: User Rate Limit ExceededALTER TABLE Animal ADD CONSTRAINT UQ_Animal_AnimalTypeId UNIQUE (AnimalType_id)
Error: User Rate Limit Exceeded TechGuy
Error: User Rate Limit ExceededthenError: User Rate Limit Exceeded
Error: User Rate Limit Exceeded TechGuy
2

Error: User Rate Limit Exceeded

ALTER TABLE Animal ADD CONSTRAINT UQ_Animal_Type UNIQUE (AnimalType_id)

Error: User Rate Limit Exceeded

Error: User Rate Limit ExceededUNIQUEError: User Rate Limit ExceededFOREIGN KEYError: User Rate Limit ExceededALTER TABLE Animal ADD CONSTRAINT FK_Animal_Type FOREIGN KEY (AnimalType_id) REFERENCES Animal_Type(AnimalType_id)
Error: User Rate Limit Exceeded TechGuy
0

Error: User Rate Limit Exceeded

ALTER TABLE Animal
ADD COLUMN AnimalType_id int;
Error: User Rate Limit Exceeded TechGuy
-1

Error: User Rate Limit Exceeded

ALTER TABLE table_name ADD CONSTRAINT UNIQUE (column_name)

Похожие вопросы