SQL: zmiana tabeli na wartość Boolean to BIT
Miało być po polsku, ale angielski też przecież łatwo zrozumieć, prawda?
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 :)
In SQL SERVER it is
BIT, though it allows NULL to be storedALTER TABLE person add adminApproved BIT default 'FALSE';
Also there are other mistakes in your query
- When you alter a table to add column no need to mention
columnkeyword inalterstatement - For adding default constraint no need to use
SETkeyword - Default value for a
BITcolumn can be('TRUE' or '1')/('FALSE' or 0).TRUEorFALSEneeds to mentioned asstringnot 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
Prześlij komentarz