Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find data type boolean [closed]

While creating a table, I get following error message.

Msg 2715, Level 16, State 7, Line 1 Column, parameter, or variable #4: Cannot find data type boolean.

When trying to use this script:

create table artists ( artist_id    int, 
                       artist_name  varchar(60), 
                       artist_dob   datetime, 
                       poster_in_stock  boolean ) 

Any suggestion to what wrong I am doing?

like image 689
Lalu Avatar asked Jun 21 '26 22:06

Lalu


1 Answers

Just change your create statment to:

create table artists ( artist_id    int, 
                       artist_name  varchar(60), 
                       artist_dob   datetime, 
                       poster_in_stock  bit ) 

There is no such type boolean in SQL, you need to use bit.

MSDN bit (Transact-SQL)

An integer data type that can take a value of 1, 0, or NULL. The string values TRUE and FALSE can be converted to bit values: TRUE is converted to 1 and FALSE is converted to 0.

like image 67
Tanner Avatar answered Jun 25 '26 01:06

Tanner



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!