web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Select Statement to auto return GP Field Name

(1) ShareShare
ReportReport
Posted on by 766

I am starting to apply a bit of SQL knowledge. I have my query to pull vendor records. I have the many address columns, and I want to change the header from the SQL name to the GP Field name, without manually adding alias's to each select.

Is there a way to do that?

Right now I have Select VAADDCDPR and I want it to read Vendor Address Code - Primary, without adding it as Alias(text).  Is there a way to auto return Field names?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Redbeard Profile Picture
    12,931 on at

    Nicole -

    The easiest way to accomplish this is to use the views that exist in Dynamics GP already.  If you go to SQL Query Analyzer, and browse to a company database then expand the Views folder. You will find a dbo.VendorAddress View, which already has the aliases you're hoping to have instead of the SQL field names. You can script these views to a query editor by right clicking on them. This can be a real time saver.

  • Verified answer
    Redbeard Profile Picture
    12,931 on at

    It occurs to me, when scripting these views as a best practice we use Script View as >> Create to >> New Query Editor Window. As the view already exists, executing the script after making modifications produces only a "There is already an object named 'VendorAddress' in the database." ERROR. You may be tempted to script a view using Script View as >> Alter to >> New Query Editor; avoid doing this, you do not want to break any of these views.

  • Napolo Profile Picture
    766 on at

    Very helpful. Thank you!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans