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 216743

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:35:34+00:00 2026-05-11T18:35:34+00:00

Sometimes I need to find some strings inside DB usually it is just host-name

  • 0

Sometimes I need to find some strings inside DB usually it is just host-name or ip address.

Is there any script which finds string in all Sybase db objects (or at least in all tables) that I have access to.

  • 0 0 Answers
  • 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-05-11T18:35:34+00:00Added an answer on May 11, 2026 at 6:35 pm

    The query on sysobjects + cursor + EXECUTE works. kinda sorta.

    sp__map_object 'SELECT * FROM %O where name like "bar%"', 'foo_%'
    

    There are so many bugs/issues/worries in the code that I am reluctant to post it but I have a certain amount of sympathy for a fellow Sybase sufferer.

    Rob Verschoor has a bunch of nice stored procedures at
    http://www.sypron.nl/new_ssp_dwn.html

    pjjH

    289:1> ? sp__map_object
    (1 row affected)
    /*
     *
     * BE CAREFUL WHEN RUNNING THIS!!!
     *
     * See list of dire warnings in sp__map_db.sql
     *
     * Run the given command on the stored procedure for each object
     * matching @object_pat and replacing the first instance of %O with that
     * name.
     *
     * Just do this in Perl. Or refactor the sql so that it works for some sane
     * cross-product of users,logins, databases and objects.
     *
     * Paul Harrington 
     *
     */
    CREATE PROCEDURE sp__map_object
      @sql             VARCHAR(255) = 'sp__help',
      @objpat          VARCHAR(32)  = NULL,
      @type            VARCHAR(2)   = 'U',
      @do_it           INT          = 1,
      @verbose         INT          = 0
    AS
    BEGIN
      SET NOCOUNT ON
      DECLARE object_cursor CURSOR
      FOR
        SELECT DISTINCT name
        FROM   sysobjects
        WHERE  name LIKE @objpat
          AND  type LIKE @type
      DECLARE @munged_sql VARCHAR(255)
    
      DECLARE @object_name varchar(64)
      OPEN object_cursor
      FETCH object_cursor INTO @object_name
      WHILE @@sqlstatus = 0
      BEGIN
        IF CHARINDEX('%O', @sql)  0
        SELECT @munged_sql = SUBSTRING(@sql, 1, CHARINDEX('%O', @sql) - 1) +
                      @object_name +
                      SUBSTRING(@sql, CHARINDEX('%O', @sql) + 2, 255)
        ELSE
          SELECT @munged_sql = @sql
    
        IF (@do_it = 0 OR @verbose = 1)
        BEGIN
           DECLARE @msg varchar(255)
           SELECT @msg = @munged_sql
           SELECT @msg
        END
    
        IF @do_it = 1
            EXECUTE(@munged_sql)
        FETCH object_cursor INTO @object_name
      END
      CLOSE object_cursor
      DEALLOCATE CURSOR object_cursor
      SET NOCOUNT OFF
    END
    
    go
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 98k
  • Answers 98k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I found the problem. It's very subtle. The selector for… May 11, 2026 at 7:35 pm
  • Editorial Team
    Editorial Team added an answer In the dropdown menu, Format->Conditional formatting... Then set your rules… May 11, 2026 at 7:35 pm
  • Editorial Team
    Editorial Team added an answer While I haven't made that particular conversion, I have gone… May 11, 2026 at 7:35 pm

Related Questions

Here at work, we often need to find a string from the list of
I have a warehouse. Sometimes I want to lookup a box location by a
I need to make a large set of tests in telnet. I am working
I need to make a rather complex query, and I need help bad. Below
I have a list of cities, states/provinces, and countries and I need to find

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.