Skip to main content

Notifications

Microsoft Dynamics GP (Archived)

Moving Servers and View for SSRS reports

Posted on by 75,730

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
    Community Member Microsoft Employee 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
    Richard Wheeler 75,730 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
    Ian Grieve 22,782 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans