Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8315899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T21:14:05+00:00 2026-06-08T21:14:05+00:00

In the following snippet, I am getting an error in line #4 (Incorrect Syntax

  • 0

In the following snippet, I am getting an error in line #4 (Incorrect Syntax near ‘=’). I need to have an equality result displayed as a column in a select statement.

declare @five int
set @five = 5

declare @bool bit
set @bool = (@five = 6)

select @five, @bool

The result set should have two columns:
5 false

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T21:14:06+00:00Added an answer on June 8, 2026 at 9:14 pm

    T-SQL does not have a real boolean type. It is a weird situation. Here is the solution:

    set @bool = case when @five = 6 then 1 else 0 end
    

    Truth expressions, which would be of boolean type in other languages, don’t have a type in T-SQL. You can only use truth expressions in special syntactic places like where, if and case.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm getting error using the following code snippet jQuery(document).ready(function() { jQuery.ajax({ url: url, type:
I have the following html snippet <table> <tr> <td><select name=day> </select></td> <td><select name=time> </select></td>
I have the following snippet of code: import csv def has_header(first_lines): sniffer = csv.Sniffer()
I'm getting the following error from g++ while trying to add iterator support for
I am getting the following error: The constructor Intent(new View.OnClickListener(){}, Class<DrinksTwitter>) is undefined In
I am getting the following error from my code: Attempt to split long or
I have summarized my problem in following code snippet using System; using System.Collections.Generic; using
I have following code snippet in c#. var list = new List<string> { a,
The following code snippet is returning an error in firebug: Parameter is not an
I have following code snippet in jquery.In which,I want to animate each element of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.