Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Moving Servers and View for SSRS reports

(0) ShareShare
ReportReport
Posted on by 75,848 Moderator

If you move your GP databases to a new server or create a test company based on an existing company, you will find many of the SSRS reports or Business Analyzer return no data. This is because the SQL views behind these reports have the sql server instance and database name embedded in them. You can use this script to create another script that will correct this. You will need to go into SSMS and run this script and then File->Save Results As. When you pull up this script you then need to change all occurrences of CREATE VIEW to ALTER VIEW.

SELECT  REPLACE(OBJECT_DEFINITION(object_id), 'Old_Server_Name', 'New_Server_Name') + CHAR(13) + CHAR(10) + 'GO'

FROM

sys.views

WHERE

CHARINDEX('Old_Server_Name', OBJECT_DEFINITION(object_id)) > 0

 

*This post is locked for comments

  • Community Member Profile Picture
    on at
    RE: Moving Servers and View for SSRS reports

    I have moved my gp databases (2010) to new 2012 sql server while leaving the deployment on the current TS.  I need to repoint my ssrs reports to the new server and once I do that that and I have ascertained all the modified reports work, I then want to move my gp 2010  install to the new 2012 server I have set up.  I can't tell from your post if your recommendations would work in this scenario? For example, are you running the scripts on the new sql server, have you move the ssrs database to the new server.  Thanks for your help.

    John

  • Richard Wheeler Profile Picture
    75,848 Moderator on at
    RE: Moving Servers and View for SSRS reports

    That is true Ian. Since doing an Edit and Replace in SSMS Query window is so simple I did even think about it. I was just amazed to see SQL instance and Server Names embedded in these views.

  • Ian Grieve Profile Picture
    22,784 on at
    RE: Moving Servers and View for SSRS reports

    Hi Richard,

    You could wrap your current replace with another one to change the CREATE VIEW with ALTER VIEW:

    SELECT  REPLACE(REPLACE(OBJECT_DEFINITION(object_id), 'Old_Server_Name', 'New_Server_Name'), 'CREATE VIEW', 'ALTER VIEW') + CHAR(13) + CHAR(10) + 'GO'

    FROM

    sys.views

    WHERE

    CHARINDEX('Old_Server_Name', OBJECT_DEFINITION(object_id)) > 0

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >

Featured topics

Product updates

Dynamics 365 release plans