Advertisement

12.06.2007 at 11:04AM PST, ID: 23006871
[x]
Attachment Details

Change Name is Sysfiles

Asked by EVANFAGER in MS SQL Server

Tags: sql, sysfiles, name, change

Our ERP system (JDE) has three enviroments each in it's own SQL Database. The easiest way to refresh the production data to the prototype enviroment is to backup the production database (PS_Prod) and restore it to the prototype enviroment (PS_CRP). This works fine with one exceeption. After the restore we run the following SQLs:
sp_msforeachtable @command1='grant all on ? to public'
and
update sysobjects
set UID = User_ID('CRPDTA')
where UID= USER_ID('PRODDTA')

These work fine
However the name is sysfiles table is wrong. The file path is correct though. Below are the results of query select name, filename from sysfile
PS_PROD_Data   E:\mssql\data\PS_CRP.mdf                                                              
PS_PROD_Log     F:\mssql\log\\PS_CRP_log.LDF                                                        
This causes a problem whenn trying to run the DBBC shrinkfile command

is there a way to change the name back to PS_CRP_Data and PS_CRP_Log in the field name in sysfiles without causing any residual problems?

Start Free Trial
[+][-]12.06.2007 at 11:14AM PST, ID: 20422228

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: MS SQL Server
Tags: sql, sysfiles, name, change
Sign Up Now!
Solution Provided By: ShogunWade
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628