SQL Server 2008 Express - How to find a record in a table with a specific text in one of its field

Posted on 2012-08-14
Last Modified: 2012-08-15

I am trying to find a record in my SQL Server 2008 express database TABLE object.
I am trying to find a record with the text "Jack" in the first name field in a table named students.
I have opened the table in SQL Server 2008 management studio by right clicking the table object and clicking 'Edit Top 1000 rows'.

Edit Top 1000 rows
Then I tried to select the 'FirstName' table column heading using the mouse but I couldn't - I actually wanted to select the table header then press Ctrl+F key to open the Find/Search dialog box and search for the text "Jack" in the first name field. This method of finding a record with a specific text in a field worked fine in MS Access.

Couldn't select table column header
So, then I tried to open the table by right clicking the table object and clicking 'Select Top 1000 rows'.

Select Top 1000 rows
Luckly I could select the First name column. However when I pressed the Ctrl+F key and searched for the text "Jack" in the first name field, SQL Server management studio says Text not found.

Searching for a record using Ctrl   F
Text not found
So, my question is, Is there a simple way of finding a record in SQL server database table containing a specific word without creating a view/query? I want to quickly find a record and edit the record directly, rather than having to create a new view in SQL Server management studio to search for the record.
Question by:ZKM128
    LVL 26

    Expert Comment

    the simplest way is running a query like this one

    SELECT *
    FROM students
    WHERE name = 'Jack'
    LVL 26

    Accepted Solution

    but if you want to do this by using the designer interface, after righ clicking and choosing the edit top 200 records of table you should open the query designer from the left of the management studio interface. once you open the designer then you should specify any query condition and sort order... I cant gave you any snapshot cause no SSMS installed on the machine currently I'm using.
    LVL 13

    Assisted Solution

    Running a query is easiest

    Like tigin44 posted you might need to use % as a wildcard

    SELECT *
    FROM students
    WHERE name = '%jack%'
    LVL 16

    Assisted Solution

    One reason you may not be seeing the results you expect is because you are only seeing the first 1000 records, if there are more than this then you would not be able to see them.

    Instead if choosing "Edit top 1000 records" choose "SELECT TOP 1000 records" and add a where clause so it looks like the below.

    SELECT * FROM Students WHERE NAME LIKE '%jack%'

    Open in new window

    From your example i can see you have an ID field too so if you want to update a specific row you could run the following update command.

    SET NAME='James'
    WHERE ID=7

    Open in new window

    Or if you wanted to set the column that has Jack in it to James you could run the following query.

    SET NAME='James'
    WHERE Name LIKE '%Jack%'

    Open in new window


    Author Closing Comment

    Thank you,

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
    Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now