SQL: zmiana tabeli na wartość Boolean to BIT

Miało być po polsku, ale angielski też przecież łatwo zrozumieć, prawda?

In SQL SERVER it is BIT, though it allows NULL to be stored
ALTER TABLE person add  adminApproved BIT default 'FALSE';
Also there are other mistakes in your query
  1. When you alter a table to add column no need to mention column keyword in alter statement
  2. For adding default constraint no need to use SET keyword
  3. Default value for a BIT column can be ('TRUE' or '1') / ('FALSE' or 0)TRUE or FALSE needs to mentioned as string not as Identifier
Może być też tak:
ALTER TABLE person
    ADD AdminApproved BIT
    DEFAULT 0 NOT NULL;


Bardzo mnie interesuje co o tym sądzisz, dlatego byłoby mi miło, jeśli byś napisał w komentarzu coś o tym, może być cokolwiek :)

Komentarze

Popularne posty z tego bloga

IntelliJ: zmiana rozmiaru czcionki scrollem

ThunderBird: jak zrobić professional stopkę