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

  • Home
  • SEARCH
  • 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 9160263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:41:49+00:00 2026-06-17T13:41:49+00:00

How should I search for an int value in a table? Actually my sql

  • 0

How should I search for an int value in a table? Actually my sql query works for string values but not for numbers.

SELECT * FROM [Book] WHERE ([bookId] = @bookId)

I’m using vs and get values from text boxes.Insert query in gridview.

bookId is an autogenerated INT value.

  • 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-17T13:41:50+00:00Added an answer on June 17, 2026 at 1:41 pm

    This question is very hard to answer unless you provide us with some more information. Useful information in this case is the table schema or CREATE statement of your Book table, consisting of a list of the attributes (or columns) in the table and their data type. It would also help to know what Database Management System (DBMS) you’re using, like MySQL, PostgreSQL, Microsoft SQL Server, Oracle Database etc.

    I am assuming that your table can be created by the following CREATE statement:

    CREATE TABLE Book (
      bookId INT,
      bookTitle VARCHAR(30),
      bookAuthor VARCHAR(30),
      ..
    );
    

    In this case, assuming (again) that your Book table contains a book with bookId 3 the following query should run without a problem:

    DECLARE @bookId INT;
    SET @bookId = 3;
    
    SELECT *
    FROM   [Book]
    WHERE  ([bookId] = @bookId);
    

    If this does not work, I would guess that the data type of your bookId attribute is not INT, but some text type. But again, it is hard to help you with only the data that you have provided so far.

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

Sidebar

Related Questions

I want to write an SQL query using the LIKE keyword. It should search
I have one table view that should be filtered by values of search field
On SQL Server 2008 R2, I am trying to read XML value as table.
I have a SQL table readings something like: id int client_id int device_id int
Possible Duplicate: Split string in SQL Searching a column with comma seperated values In
I' writing a search function in C# SQL Server, my users can select multiple
I'm searching now for a while but can't find an entrance… The application should
I have asked What should i know about search engine crawling? Now i would
I created a div(search result term bar) which should display only when user enters
When you are building URLs that should be legible for users and search engines

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.