Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Join Date
    Sep 2007
    Location
    India
    Posts
    21

    Unanswered: Replacing a text globally

    I have a instance with many databases in it.

    due to company/product name change,

    I want to search for a string "xyz" in
    database name,
    table name,
    column name,
    stored procedure name
    content of all stored procedures

    and replace all of them with "abc" without affecting the databases an application.

    Can u please help me with step by step guidance?

    muralidaran r

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    You want to change the names of things without affecting an application that uses this data?
    Slow down and think about what effects this will have.
    George
    Home | Blog

  3. #3
    Join Date
    Sep 2007
    Location
    India
    Posts
    21

    Change in application

    hi

    thanks for your reply

    the only change expected from application is the change of connection string.

    Muralidaran r

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Your application doesn't do anything like
    Code:
    SELECT Field1 FROM xyzTable
    ?
    George
    Home | Blog

  5. #5
    Join Date
    Sep 2007
    Location
    India
    Posts
    21

    No

    My application code never uses table name or column name.

    it uses only stored procedure names.

    muralidaran r

  6. #6
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Quote Originally Posted by muralidaran r
    I want to search for a string "xyz" in
    database name,
    table name,
    column name,
    stored procedure name
    content of all stored procedures
    I rest my case.
    George
    Home | Blog

  7. #7
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    If your application calls stored procedure names have "xyz" in them, then there is no solution to your problem... When you rename the called procedures, the application will fail (because it will still try to use the old names that contain "xyz" instead of "abc").

    -PatP

  8. #8
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Quote Originally Posted by muralidaran_r
    due to company/product name change,

    Can u please help me with step by step guidance?
    Sure, learn how to code correctly
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  9. #9
    Join Date
    Sep 2007
    Location
    India
    Posts
    21
    Thank you guys. Now I will retype the question. try to understand better. Actually the coding was done by someone else and now i have to manage this. OK. try to give a solution.

    I have a instance with many databases in it.

    due to company/product name change,

    I want to search for a string "xyz" in
    database name,
    table name,
    column name,
    content of all stored procedures

    and replace all of them with "abc"

    Can u please help me with step by step guidance?

    muralidaran r

  10. #10
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    It shouldn't be done IMO.
    Users don't see database name(s), table names, column names or content of stored procedures. Users should only see data that you let them see.
    George
    Home | Blog

  11. #11
    Join Date
    Sep 2007
    Location
    India
    Posts
    21

    Please Listen

    How to search for a string "xyz" in

    database name,

    table name,

    column name,

    content of all stored procedures


    muralidaran

  12. #12
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10

    No, you listen!

    Quote Originally Posted by muralidaran r
    I want to search for a string "xyz" in
    ...
    and replace all of them with "abc"
    I did listen and I responded appropriately. My advice is don't do it, simple as that.

    As always you can chose to ignore my advice but I can assure you that others will respond in a similar fashion.
    George
    Home | Blog

  13. #13
    Join Date
    Sep 2007
    Location
    India
    Posts
    21
    Hi

    Already i started changing the string by some manuall method which is tedious and hard.

    at each and every stage i am checking the applications performance and accuracy.

    I need help to speed up this.

  14. #14
    Join Date
    Jun 2004
    Location
    Long Island
    Posts
    696
    Speaking from a SQL2000 perspective, you need to check "name" in sysobjects for tablenames, view names, proc names, etc. You need to check text in syscomments for sproc content, etc, you need to check syscolumns for column names, etc.

    I'm sure for every place you catch, there will be 2 you don't catch.

    I'm with GeorgeV, DO NOT DO IT. Let sleeping dogs lay.

    Have fun.

  15. #15
    Join Date
    Nov 2005
    Posts
    122
    Dear muralidaran_r,

    Have you understood what the users here are telling you?
    If you change a table name from xyzMyTable to abcMyTable, then all views, triggers, procedures functions, client side calls etc must be modified to point to the new name.

    Or are you asking how to search for and change data stored in the tables?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •