cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BrianHFASPS
Continued Contributor
Continued Contributor

Patch to Azure SQL on Boolean - true / false or 1/0?

I am wondering if there is a difference between true/false or 1/0 in Patch statements when writing to an Azure SQL table with a column defined as Boolean. I am realizing that I seem to be using them interchangeably and I am wondering if that is "bad" form.

1 ACCEPTED SOLUTION

Accepted Solutions
timl
Super User
Super User

@BrianHFASPS 

In SQL Server, the data type we would use to store true/false is 'bit' - a data type that stores 0 or 1.

SQL Server will convert true to 1, and false to 0 as stated in the documentation. Therefore, there is no difference between patching true/false or 1/0, and I would not say that patching 1/0 is "bad" form.

https://learn.microsoft.com/en-us/sql/t-sql/data-types/bit-transact-sql?view=sql-server-ver16

In general however, my preference is to patch true/false as I believe it is more readable for those unfamiliar with the 1/0 convention.

 

View solution in original post

2 REPLIES 2
timl
Super User
Super User

@BrianHFASPS 

In SQL Server, the data type we would use to store true/false is 'bit' - a data type that stores 0 or 1.

SQL Server will convert true to 1, and false to 0 as stated in the documentation. Therefore, there is no difference between patching true/false or 1/0, and I would not say that patching 1/0 is "bad" form.

https://learn.microsoft.com/en-us/sql/t-sql/data-types/bit-transact-sql?view=sql-server-ver16

In general however, my preference is to patch true/false as I believe it is more readable for those unfamiliar with the 1/0 convention.

 

BrianHFASPS
Continued Contributor
Continued Contributor

I just found out one difference in delegation.

BrianHFASPS_0-1663967612433.png

BrianHFASPS_1-1663967641881.png

No blue line with true!

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,782)