1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

"There is already an object named xy in the database azure data"

Discussão em 'Outras Linguagens' iniciado por Stack, Janeiro 3, 2021.

  1. Stack

    Stack Membro Participativo

    I am currently learning how to create databases with azure data studio

    After creating a database I always get this error :

    "There is already an object named "Menschen" in the database"


    and

    Msg 1778, Level 16, State 0, Line 1
    Column 'Wohnorte.Postleitzahlen' is not the same data type as referencing column 'wohnt_ine.Postleitzahlen' in foreign key 'FK__wohnt_ine__Postl__0A9D95DB'.

    Msg 1750, Level 16, State 0, Line 1
    Could not create constraint or index. See previous errors.


    This is what it currently looks like:

    create table Menschen (
    Vornamen varChar(30) not null primary key,
    Geschlecht varChar(30) not null,
    Ursprung varChar(30),
    );

    create table Wohnorte (
    Stadt varChar(30) not null,
    Postleitzahlen character(5) not null primary key,
    Bundesland varChar(30),
    );

    create table wohnt_ine (
    Vornamen varChar(30) references Menschen,
    Postleitzahlen character(5) references Wohnorte,
    primary key (Vornamen, Postleitzahlen),
    );

    Continue reading...

Compartilhe esta Página