Alias "generator"

ktaylor1968ktaylor1968 Posts: 10
edited August 6, 2010 12:17PM in SQL Prompt Previous Versions
I just purchased SQL Prompt and would love to set up some aliases for our database tables. We have a 3rd party app that really used some pretty intuitive table and column naming structures.

Our Customer table is named co_customer and all of it's column names begin with cst_. cst_key, cst_id, cst_recno.

Our Invoice table is name ac_invoice and all of it's column names begin with inv_. inv_key, inv_code, inv_trx_date and even an inv_cst_key.

I would love to import a list of 1200 table names and aliases without pressing the "add" button and typing in each one. I can easily query these table name's and prefixes from our database.

Any ideas? I literally downloaded the program today, so I'm very new to it. Looks absolutely great so far. I'm just hoping there's some sort of import for the Aliases.

Thanks all!

Comments

  • Anu DAnu D Posts: 876 Silver 3
    Many thanks for your post Keith.

    I really don't know how you like to achieve this but I will like to share another way of inserting Aliases other than UI which I think can help you or give you an idea how Aliases in SQL Prompt works.

    As soon as you define an alias in UI the XML file RedGate_SqlPrompt_Engine_EngineOptions.xml under the node <UserDefinedAliases>.
    You can find the file here: %USERPROFILE%\AppData\Local\Red Gate\SQL Prompt 4\RedGate_SqlPrompt_Engine_EngineOptions.xml.

    This is the only way to add Aliases if you do not want to do it through UI.

    Kindly let me know if you need more information on this.
    Anuradha Deshpande
    Product Support
    Redgate Software Ltd.
    E-mail: support@red-gate.com
  • ktaylor1968ktaylor1968 Posts: 10
    edited August 6, 2010 9:42AM
    I'm having a problem locating that file. I installed the toolbelt on my local machine. I've done searches on every portion of the filename you specified. The only mention I can find of RedGate is in my C:\Program Files\Red Gate.

    The only thing I did differently from a "default" install was to install each tool in their own directory, through that option on the install utility.
  • Anu DAnu D Posts: 876 Silver 3
    What is OS version?
    Anuradha Deshpande
    Product Support
    Redgate Software Ltd.
    E-mail: support@red-gate.com
  • Windows XP version 5.1.2600
  • Anu DAnu D Posts: 876 Silver 3
    Can you change your folder settings to show hidden folders and look for

    %USERPROFILE%\Application Data\Red Gate\SQL Prompt 4?
    Anuradha Deshpande
    Product Support
    Redgate Software Ltd.
    E-mail: support@red-gate.com
  • I have \Application Data\Red Gate folder but the only thing in it is SQL Refactor.
  • Anu DAnu D Posts: 876 Silver 3
    Can you confirm you have SQL Prompt 4 installed?

    Check in your Add/Remove Program for SQL Prompt 4 and if not install it from here:

    http://www.red-gate.com/MessageBoard/vi ... hp?t=10248
    Anuradha Deshpande
    Product Support
    Redgate Software Ltd.
    E-mail: support@red-gate.com
  • I've been using it... I had not done the Activiation key yet, so I just finished with that and rebooted my system. It's still not out there. Should I do the uninstall/reinstall? Thanks for your help on this!
  • Anu DAnu D Posts: 876 Silver 3
    No problem!

    Can you kindly uninstall the existing SQL Prompt and install the latest version?

    Link is enclosed in previous post.

    Kindly let me know this helps or not.
    Anuradha Deshpande
    Product Support
    Redgate Software Ltd.
    E-mail: support@red-gate.com
  • Still don't have a SQL Prompt folder under the Red Gate folder...
  • Anu DAnu D Posts: 876 Silver 3
    Can we have a remote session?

    I will email you the steps you need to follow to initiate live chat with me.
    Anuradha Deshpande
    Product Support
    Redgate Software Ltd.
    E-mail: support@red-gate.com
  • Hold on... It was further down than I thought...

    It's under the Local Settings directory...
  • Anu DAnu D Posts: 876 Silver 3
    Oops!! good you found it :)

    Does it have the XML file I asked to look into?
    Anuradha Deshpande
    Product Support
    Redgate Software Ltd.
    E-mail: support@red-gate.com
  • Yeah, there's a "Application Data" under my username and then there's a "Local Settings" with another "Application Data" under there.

    Sorry about that... It does have that XML file!

    I really appreciate your time!


    Thanks!
  • I can't get this to work. When I open the XML file, it has > and < for the > and < signs. If I do a mass replace and close and open the file, it seems to be alright if I don't change anything.

    As soon as I do my query and "FOR XML PATH" with the node name and just try to copy one node in, it won't keep it. It's like it resaves to it's last recollection of what the file was like before updating. I've updated the count as well to reflect 3 Aliases.
Sign In or Register to comment.