MYSTERY ZILLION တွင် English သို့မဟုတ် Unicode ဖြင့်သာ အသုံးပြုခွင့်ရှိသည်။ ဇော်ဂျီ ၊ ဧရာ စသည်တို့ကို အသုံးပြုခွင့် မရှိ။ Unicode Guide ကို ဒီမှာ Download ချပါ။ Zawgyi to Unicode Converter
Don't share ebook or software if nobody request. You can find free book websites on here. We are welcome for discussion or asking question instead.
MS SQL Key Problem
  • Vote Up0Vote Down winlwinwinlwin
    Posts: 241Registered Users
    /* Create Hotel Table */

    CREATE TABLE Hotel (
    hotelNo numeric(10),
    hotelName varchar(20),
    city nvarchar (10),
    CONSTRAINT hotel_PK PRIMARY KEY(hotelNo));

    /* Create Room Table */

    CREATE TABLE Room (
    roomNo numeric(10),
    hotelNo numeric(10),
    type nvarchar (20),
    price money,
    CONSTRAINT room_PK PRIMARY KEY (roomNo, hotelNo),
    CONSTRAINT hotel_FK FOREIGN KEY (hotelNo) REFERENCES Hotel(hotelNo) );

    /* Insert into Hotel Table */

    INSERT INTO Hotel VALUES
    (5431, 'Ritz', 'London'),
    (5551, 'Marriott', 'London'),
    (3451, 'Marriott', 'Paris'),
    (1122, 'Riverside', 'Berlin'),
    (1342, 'Imperial', 'London'),
    (7782, 'Triumph', 'Paris');

    /* Insert into Room Table */

    INSERT INTO Room VALUES
    (910, 5551, 'Double', 255),
    (915, 5551, 'Family', 345),
    (448, 7782, 'Double', 15),
    (110, 1122, 'Double', 39),
    (910, 1345, 'Single', 27),
    (448, 1121, 'Suite', 115);
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    I can run first three queries successfully, but the last one, i got the following error. Hope someone can shed a light for me. Thanks.

    Msg 547, Level 16, State 0, Line 3
    The INSERT statement conflicted with the FOREIGN KEY constraint "hotel_FK". The conflict occurred in database "mydb", table "mydb.Hotel", column 'hotelNo'.
    The statement has been terminated.
  • 2 မှတ်ချက်များ sorted by
  • Vote Up0Vote Down CalmHillCalmHill
    Posts: 1,179Administrators
    (910, 1345, 'Single', 27)
    (448, 1121, 'Suite', 115)


    အပေါ်မှာပြထားတဲ့ Values နှစ်ခုကြောင့်ပါ ဟိုတယ်နံပါတ် 1345 နဲ့ 1121 ဆိုတာ အပေါ်မှာမရှိပါဘူး။ အဲဒါကြောင့် referential integrity နဲ့ငြိပါတယ် ထည့်လို့မရပါ။ အဲဒါကြောင့် 1342 နဲ့ 1122 အဖြစ် ပြောင်းရင်ပြောင်း ဒါမှမဟုတ် 1345 နဲ့ 1121 ကို Hotel မှာသွားထည့်ရင်ထည့်ပါ။
  • Vote Up0Vote Down winlwinwinlwin
    Posts: 241Registered Users
    Thanks you. I need to sleep now. I already double checked the data and didn't spot it. :)
ဆွေးနွေးမေးမြန်းခြင်းစတင်ရန်

မင်္ဂလာပါ!

လှိုက်လှဲစွာကြိုဆိုပါသည်။ ယခု ပထမဆုံးအကြိမ် ရောက်ဖူးခြင်းဖြစ်ပါသလား? ဝင်ရောက် ဆွေးနွေး မေးမြန်းလိုပါလျှင် အောက်တွင်ဖော်ပြထားသော button များမှတဆင့် ဝင်ရောက် ဆွေးနွေးနိုင်သကဲ့သို့ အဖွဲ့ဝင်အသစ်အနေဖြင့်လည်း လျှောက်ထားနိုင်ပါတယ်။

Facebook ဖြင့်ဝင်ရန် Google ဖြင့်ဝင်ရောက်ရန် OpenID ဖြင့်ဝင်ရောက်ရန် Twitter ဖြင့်ဝင်ရောက်ရန်

အမျိုးအစားများ

In this Discussion