SRK Consulting

mssql_grep

Home
Resume - Short
Resume - Long Word doc
Software & Misc
Firewatch (perl)
mssql_grep (perl)
pstree (c)
Vim syntax files for Netcool
NATCheck (expect)
Perl/Tk Screenshots
Temperature Monitor
Work & Demo sites
phpCollab
phpMyAdmin
phProjekt
Call Center Stats
Fitness
RemindMe
Cookie Test
Flatfile/form demo
Asthma/Allergy Clinic
Gary
Neil
Hobbies & Misc
Google Maps Links
Hard Drive Clocks
Theatre Props & Devices
Electronic Candles
Chase Light Controller
Magic Sword Prototype
Theatrical Lighting
South Pacific
(Fargo North High, 2004)
42nd Street
(West Fargo High, 2005)









Perl source       Standalone Windows .exe, plus source
mssql_grep  - print MS SQL Server 2000 tables/fields where the field value
              matches a pattern and optionally search/replace

Author: Scott R. Keszler <keszler@srkconsulting.com>

Run `mssql_grep --help` for usage message.

usage: $basename -h host -d db -u user -p passwd 
                 -t &| -v 
                 -L &| -l "SQL like expression" 
                 [-i] [-T] [-N] [-D] [-s] [-S] [-f file]

  Required:
    -h SQL Server hostname
    -d database name
    -u username (allowed to read host/database)
    -p password

  Use one or both:
    -t seach tables
    -v search views

  Use one or both:
    -L list all table and field names found, and distinct types
    -l SQL "like" expression for which to search in fields
       (use -l "%expression%" to find a substring)
       (use \t for tab, \r for return, \n for newline)

  Optional:
    -i perform case-insensitive search
    -T search text/ntext fields also (limited to first 65,535 characters)
    -N search numeric fields also (cast as varchar)
    -D search date/time fields also (cast as varchar)
    -s search system tables/views only
    -S search system tables/views also (overrides -s)
    -f filename for results
    -r search/replace search string (requires -R)
    -R search/replace replace string (requires -r)
    -I search/replace all-upper and all-lower case variants of -r and -R

  Example:

    mssql_grep -h hostname -d DBname -u username -p passwd -t -l "%search_string%" -I -T -r search_string -R replacement
          
For more information on SRK Consulting products and services, please e-mail keszler@srkconsulting.com or phone +1-701-361-8406.
This page, and all contents, are Copyright © 1994 by SRK Consulting, Fargo, North Dakota, 58102.